If you are developing with WSS/MOSS, this is a known message. A lot of unexpected errors are displayed simply as “An unexpected error has occurred.”. Some of them you can debug in the sharepoint log files, some of them you can find details in the event log, and some… you can’t find anything… those are pure and simple desperation until you hit with your head enough times to almost develop a 6th sense; with this sense you start guessing where the problem comes from.

The biggest problem about this type of errors is that the debug process is VERY time consuming.

Well, today I came across a very smart approach for this problem. You just implement a HTTPModule that catches the exception prior to being treated by MOSS and logs it where ever you want.

This is an article with a lot of common scense and doesn’t apply directly to WSS/MOSS but to all web sites. A must read. You can find it here: Exceptional Performance : Best Practices for Speeding Up Your Web Site.

Sometimes (more frequently than I could wish for) a webpart brakes a page and stops you from editing any further. If you find yourseft in such a situation, add the string “?contents=1” as in http://mysite/somepage.aspx?contents=1. This will lead you to the webpart deactivation page where you simply disable/remove the broken webpart.