Detect an error

Jan 25, 2012 at 10:15 AM

How can I detect an error? I see a message box pops up but can't find that code generating it. Is there an error event of some such?