SharePoint (MOSS 2007) Enable Custom Errors
There are many reasons that you may see the "An unexpected error has occurred" page in SharePoint. Troubleshooting an issue that causes this message to be displayed would be hard as there is no information provided about the actual cause of the error unless you refer to the servers error logs. By default, SharePoint is configured in the web.config file of the website hosting SharePoint to suppress error messages and the error stack trace. This is because the information displayed in the error will not be understood by most end users and also gives the impression that a more serious error had occurred.
By modifying the web.config file, you can enable custom errors for the SharePoint web application, so that the full details of the error are displayed in the browser when it occurs. Other options configurable via the web.config file include enabling call stack trace, which will trace the cause of an error back to the logical component that failed.
Debugging can also be enabled in the web.config file, as well as the ASP.NET tracing feature.
To enable custom errors:
Find:
<system.web> ...
<customErrors mode="On" />
Change To:
<system.web> ...
<customErrors mode="Off" />
Enable the Call Stack Trace:
Find:
<SharePoint>
<SafeMode ... CallStack="false" ... >
</SharePoint>
Change To:
<SharePoint>
<SafeMode ... CallStack="true" ... >
</SharePoint>
Enable Debugging Mode:
Find: <compilation batch="false" debug="false">
Change To: <compilation batch="true" debug="true">
Enable the ASP.NET tracing feature: Add the following line to the <system.web> element
<system.web> ...
<trace enabled="true" pageOutput="true"/>
More information about enabling custom errors in SharePoint.
Need help finding the right web.config file: See Where is SharePoint web.config?
Submit a review:
Login required.