Advice Catching Exceptions – a trick from a mentor

Using ASPX – we catch general exceptions – well some messages are too general. Here is some advice emailed to me from a mentor and friend Sjoerd.

UPDATE: Be careful on what messages get thrown/exposed to the final client. If there are open data that is sensitive – the advice below might bee too revealing.

When catching errors, please make sure you bring back the following properties from the exception:

  • Ex.StackTrace
  • Ex.Message
  • Ex.InnerException

He included these links

If you like, you can throw an exception on purpose and look at what the properties will return you.