In March of 2009 I talked about Catch (Exception e): Right or wrong?. Since that time I've gotten into the habit of also deriving my custom application exceptions from the .NET ApplicationException rather than just Exception. This .NET class serves to help identify exceptions that are specific to an application, hence the name.
To make things really easy for us to create application-specific exceptions, use the Visual Studio 2010 code snippet, "exception". Be sure to use the tab key to update the base class to ApplicationException. The snippet contains all the code to adhere to the exception derivation best practices.
Very handy!
Just some random development ramblings mostly related to the Microsoft .NET platform.
Subscribe to:
Post Comments (Atom)
Can't RDP? How to enable / disable virtual machine firewall for Azure VM
Oh no! I accidentally blocked the RDP port on an Azure virtual machine which resulted in not being able to log into the VM anymore. I did ...
-
Here is a full test program that demonstrates how to use SharpZipLib to zip an XElement into a byte array. This allows you to transfer larg...
-
Oh no! I accidentally blocked the RDP port on an Azure virtual machine which resulted in not being able to log into the VM anymore. I did ...
No comments:
Post a Comment