Exception handling

Exception handling is fundamental when running any application.

Below we are sharing our own knowledge about exception handling. We would be eager to hear if you have any comments or questions, so don't hesitate to use our forum.

Getting started

Exception handling

Explains exception handling and how it differs from using error codes.

Exception classes

Learn more about exception classes and how you use them in exception handling.

Best practices

Our own best practices to get effective exception handling in .NET.

Do not catch exceptions

exceptions. Before going into the best practice let's define what"handled" means in the case of exceptions.

Use argument exceptions

Fulfil the contract or die trying

Always reproduce errors

Try to include context in the exception message

Avoid "throw ex;" in catch blocks