Don’t use Exception.Message
I tend to avoid using the Exception.Message property when reporting or logging exceptions and use Exception.ToString() method instead.
The Exception.Message property only contains the exception message where the Exception.ToString() method contains all the good stuff like stack trace and inner exceptions.
Anyone who’s ever felt the pain of production code where the developer only logged the exception message knows what I’m talking about. Why? Because “Object reference not set to an instance of an object” is not very useful all by it’s self.
Notes
-
howardtharp liked this
-
dowding posted this