Global Exception / Error Handling in AS3

Right now when I miss an error in my Application there isn’t any way for me to be notified that an uncaught exception has occurred. (PLEASE correct me if I’m wrong on that… like some low level undocumented super hack?)

I know this got shelved way back when but I wanted to start a post to maybe get this feature implemented for Flex 3.

I know Ely has said that this would be extremely hard to do anywhere but inside the flashplayer itself but I wanted to let the Adobe folks know that this is one of those REALLY nice to haves. If I don’t want to wrap “every” piece of code in a try catch I still want to be able to log/handle that exception some where.. some how.

7 Responses to “Global Exception / Error Handling in AS3”

  1. senocular Says:

    If you install the Debug player, uncaught exceptions should be visible via popup dialog

  2. Clint Modien Says:

    Thanks seno… loved your 100 Actionscript3 tips. . It’s fantastic that it it notifies my eyes with the debug player. But I need something like this for as3.

  3. zwetan Says:

    well, I suppose you just have one main entry point in your code

    then just wrap this one in a try/catch and it should catch any errors

    in case you can not/don’t want to use the debug player

  4. janosch Says:

    I miss this possibility too.
    Why is the Application.error not fired when an exception is not caught?
    If the debug-player can show the stack trace, why cant we get an Event somewhere.
    Since evrything occurs based on an event, the best place to catch all not yet caught exceptions would be in the EventDispatcher.dispatchEvent i think.

  5. janosch Says:

    i entered it in the bug-database, you can vote for it: http://bugs.adobe.com/jira/browse/ASC-3060

  6. Aaron Says:

    They’ve moved it into a feature request. Here’s the new url:

    http://bugs.adobe.com/jira/browse/SDK-11423

  7. Joshua Says:

    This feature is sorely needed - I sure hope they get this into the next version of the Flash Player.

Leave a Reply