There's a pretty useful feature (IMHO) in the .Net 2.0 Exception object which I hadn't noticed before. The Exception object contains a new Data interface, which is essentially an IDictionary for applying additional values to the exception object. I am currently using it with my integration of the new VS2005 Enterprise Library into our framework.
I want to log exceptions to a database, but I have found it useful in the past to have an Error #. In the old days (VB 6, for example) I could usually look at the error number of an application and tell exactly what the problem was. When .Net came into being, we lost the error number, and there was no easy way to get around it. You could roll your own exception classes of course and add these properties, but this is only a limited solution because other exception handlers wouldn't be capable of handling the additional features by default.
Now this feature is going to allow me to take advantage of error numbers by classifying each exception type, and appending an error number to the exception object. I can use this information in my database to classify and group errors by type to identify weak areas in an application as well. Not Earth shattering, but still a useful feature full of all kinds of possibilities.
Powered by: newtelligence dasBlog 2.3.9074.18820
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, © Copyright 2010
E-mail