Troubleshoot SharePoint Unexpected Error
Have you ever been shocked by the fact that SharePoint is sometimes does not show a very friendly error? Let’s say you are doing a deployment or modifying a piece of your code and in your face you get an “Unexpected error”? Well my friend, you are not alone. (To me, this error reminds me of the infamous catastrophic fauilure found in earlier VB which used to be my favorite runtime error)
But don’t dispair, the unexpected error can be worked around given the possibility that you have access to the site’s web config.
What you need to do is go into the web config and into the SharePoint > SafeMode tag just edit the CallStack attribute and set it to true. Also you need to set the CustomErrors tag to off.
Just like magic! Your error comes up and you can understand the exception.
However, be polite and return it to false when done. And oh yes, don’t do this in production servers. It is bad manners. Do it in INT, Testing or PreProd environments.