Web Parts generally should show error messages within the web part. While event handlers will need to show the errors in a log perhaps. There is also another way, an easy way to show these type of errors.OOTB the WSS API provides a sleek one liner to handle things that go wrong in custom SharePoint components and show the system error page with our custom message.
The one liner:
SPUtility.TransferToErrorPage()
You can even pass a link so the user has a choice to come back to the active\home page of the site and start again
Information given by Rai