Exception.Message vs. Exception.ToString()

Provided by Dave Juth, Senior Systems Architect

Exception.Message and Exception.ToString() are similar, but you should determine which to use based on how much exception information you need:

  • Exception.Message contains a simple description of the exception (e.g. "Object reference not set...").
  • Exception.ToString() contains a description of the exception along with a complete stack trace.

In order to debug an application, seeing the stack trace is critical. This is useful for logging exceptions in an application. If you need to simply show the user information about the exception at run-time, Exception.Message is more appropriate.


Additional Resources

 

 

Thank you! Thank you! I just finished reading this document, which was part of a link in the recent Buzz newsletter. I have printed it for others to read, especially those skeptical on the powers of Access and its capabilities.

Darren D.


View all FMS products for Microsoft Access All Our Microsoft Access Products

 

 

Free Product Catalog from FMS