Back
Close

Exception Handling in C#

AramT
5,570 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
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants