Mat
Mat

Reputation: 567

AIR / ActionScript 3.0: error logging

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?

Upvotes: 2

Views: 1385

Answers (2)

gaurav_gupta
gaurav_gupta

Reputation: 61

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().

Upvotes: 1

Constantiner
Constantiner

Reputation: 14221

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

Upvotes: 6

Related Questions