Back
Close

Exception Handling in C#

AramT
25.8K views
Previous: Examples

Always make sure to properly handle exceptions in your C# code, whenever you sense a code block that might generate an error, due to any reason. When handling exceptions, add the catch block beginning with the most specific exception that you think it will occur, then go less specific until most generic. Avoid catching exceptions without taking the needed actions and follow the practice of logging all your exceptions.

Article has been ported from CodingSonata.com

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io