One of the most anticipated features of Flash Player 10.1/AIR 2 was global error handling. Global error handling lets you use one class to handle any uncaught errors in your code:
flash.events.UncaughtErrorEvent
Very, very handy. Description and code examples in the ActionScript 3.0 Reference:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/UncaughtErrorEvent.html