Custom Exception Handling "Best Practise"
-
Hello Im writing an application that will implement its own custom exceptions Just wanted to hear if anyone has any input before I start on how to do this "best practise"?? Cheers Spaz
Derive new classes from existing exceptions. Use ApplicationException as a base, not Exception.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.
-
Derive new classes from existing exceptions. Use ApplicationException as a base, not Exception.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.
Christian Graus wrote:
Use ApplicationException as a base, not Exception.
Not really. From MSDN's Best Practices for Handling Exceptions[^]: For most applications, derive custom exceptions from the Exception class. It was originally thought that custom exceptions should derive from the ApplicationException class; however in practice this has not been found to add significant value. /ravi
My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com