I've been learning how to develop parts for WSS 3.0 and have found that debugging them is a real pain. I picked up this tip from SharePoint Development and Programming FAQ which has proven helpful.
Problem
You receive “The "yourWebPartName" Web Part appears to be causing a problem” or a generic error message when developing a web part.
Cause
Exceptions are caught by SharePoint and a friendly error message is displayed instead of a stack trace.
Resolution
To configure SharePoint to display the full exception needed for debugging make the following changes to your SharePoint site’s web.config file (typically located in \Inetpub\wwwroot\wss\VirtualDirectories\yoursite).
· Find: <SafeMode CallStack="false" />
· Replace with: <SafeMode CallStack="true" />
· Find: <customErrors mode="On" />
· Replace with: <customErrors mode="Off" />
· Find: <compilation debug="false" />
· Replace with: <compilation debug="true" />