2
votes

in order to create a logfile if anything goes wrong during execution of my AIR app, I added a global exception handler like this:

        private function onUncaughtError(e:UncaughtErrorEvent):void
    {
        e.preventDefault();
        var error:Error = e.error;
        Logger.log("Uncaught Error:" + " - Message: " + error.message, "session");
    }

what this gives me in the logfile is something like this:

Uncaught Error - Message: Error #3003: File or directory does not exist.

Is there any way I can log a bit more of information? like for example what object the error has thrown?

2

2 Answers

6
votes

You can use Error.getStackTrace(). See more details here.

1
votes

Error.getStackTrace() will only give at the time of debugging or when you are running your app using flash builder.

If you have made installer of .exe of your air app than it won't work with Error.getStackTrace().