Welcome to TechNet Blogs Sign in | Join | Help

Getting more value from your error in SharePoint

Error messages are a means of trying to understand why we hit a problem.  Some are helpful while others are not.  Something like "An error occurred" is not meaningful enough to help us drill deeper into an issue to assist in identifying the root cause.

There are steps that we can to give us a more "verbose" set of error messages.  This will take effect on OOB built-in functionality as well as any custom components you have installed.

Consider this example.  When we upload a document into MOSS we hit a problem (I've masked the filename on purpose) :

image

Obviously this isn't all that helpful.  We could do with some more detail.  Thankfully this is possible by changing a few settings in the web.config for your web application.  You will need to change the value of CallStack and customErrors to true and Off respectively.  Note that changing web.config will cause your application pool to recycle so these changes should take effect immediately.

<SharePoint>
    <SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
      <PageParserPaths>
      </PageParserPaths>
    </SafeMode>

</httpHandlers>
    <customErrors mode="Off" />
    <httpRuntime maxRequestLength="51200" />
    <authentication mode="Windows" />

 

With the changes above when I upload the document instead of the error above we get the one below.  Obviously this offers me much more detail and I can use the exception information to help me search for known issues.

image

Published Thursday, January 29, 2009 11:23 AM by paulki

Comments

No Comments
Anonymous comments are disabled
 
Page view tracker