Home > Computer > Programmazione > c# try catch

C# Try Catch

c# try catch

Beside logging the exception you might decide to display error message to user i consider it as a business rule

You can also use a predicate expression that further examines the exception to decide whether to handle it

Dettagli su c# try catch

File

trovare File

Show “Impossibile trovare il file ” + txtNomeFile

“Impossibile trovare il file ” + txtNomeFile

An Exception

generare An Exception

A try/catch block is placed around the code that might generate an exception

If You

disporre If You

TIL that the debugger in VS will not call the dispose method if you use the first block of code

If The

stare If The

A task can also end up in a canceled state if the asynchronous process that returns it is canceled

To Handle

decidere To Handle

You can also use a predicate expression that further examines the exception to decide whether to handle it

Error Message

decidere Error Message

Beside logging the exception you might decide to display error message to user i consider it as a business rule