SharePoint & Custom Errors

Since SharePoint is a User centric product, it has custom error pages by default. Recently I had a bug in one of my features and only on the productional environment. The error message was "An unexpected error has occurred" with nothing written to log files, trace or the event log.... Great!

Now, you could debug the problem by adding comment & funneling the problem, but that didn't help in this case, so I had to loose the custom error page.

This is what needs to change in the web.config, first modify the custom error entry:
<customErrors mode=“Off“/>

and, if you want to see the callstack, change it to
<SafeMode MaxControls=“200“ CallStack=“true“…

This will change the custom "An unexpected error has occurred" to the standard ASP.Net error page!

Don't forget to change it back when you're done debugging!!!

0 comments:

Post a Comment