I think there was a component that allowed to create global error handling.
For example I myself throw exception when something bad happens, for example
MSDN is your friend: http://msdn.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx