Thursday, November 9, 2017

IIS development and exceptions

In a production environment it is often a good idea to hide some errors of e.g.: a web-page to be able to work on the root cause of the error in the background that finally the customer will not identify some strange behavior as a bug.

Exactly the opposite is true for developers and testers. Find bugs! Don't cover them with any UI candy or stuff... and exactly in this trap I fell into...

see customErrors on msdn: https://msdn.microsoft.com/de-at/library/h0hfz6fc(v=vs.110).aspx

and for web api 2 see: https://msdn.microsoft.com/en-us/library/system.web.http.filters.exceptionfilterattribute(v=vs.118).aspx
https://docs.microsoft.com/en-us/aspnet/web-api/overview/error-handling/exception-handling

see also AppDomain.UnhandledException, Application.ThreadException / Application.SetUnhandledExceptionMode (for WinForms), DispatcherUnhandledException (for WPF), Application_Error (IIS Global asax)

Be careful to disable stuff that makes it hard to find bugs during testing :-) 

No comments: