Friday, October 30, 2015

.NET Exceptions

This post may seem obvious, but is something that I never knew for sure until today.  When an exception is raised, a stack trace is included as a property of the exception that describes where the exception occurred.  The stack trace will always reveal the method where the exception originated.  Even if Function A calls Function B, and Function B raises an exception that is caught in Function A, Function B will be in the stack trace.  This small bit of knowledge can save a bunch of time, because if Function A is in the stack trace, you can rest assured that it didn't happen in Function B.

No comments:

Post a Comment