View unanswered posts | View active topics



Reply to topic  [ 1 post ] 
displaying runtime errors in android/ios installed app 
Author Message
Member

Joined: Wed Dec 07, 2011 11:44 pm
Posts: 9
Reply with quote
I posted this on the adobe air forums but I thought I'd take a shot here as I know there's a ton of knowledgeable folk on this board.

I've been trying to get errors to display in a text field within the app for ease of error reporting from users.

I've had some success using this at the top level of the app but it's not working on device:

//start code
this.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, errorHandler);

function globalErrorHandler(event:UncaughtErrorEvent):void
{
var message:String;
//check for runtime error
if (event.error is Error)
message = (event.error as Error).getStackTrace();
//handle other errors
else if (event.error is ErrorEvent)
message = (event.error as ErrorEvent).text;
else
message = event.error.toString();
//do something with message (eg display it in textfield)
myTextfield.text = message;
}
//end code

At first this wouldn't work on the device and I thought it was because upon the error when developing on the pc flashplayer would display the action script popup with the error. Which you would need to dismiss all or close and then the globalErrorHandler was called after and the error written to the textfield. I thought this is what was keeping it from showing up on the device. However, by adding event.preventDefault() I was able to supress the actionscript dialoge when developing on the desktop and the error was written to the textfield. This was not the case however on the andriod device. It still just hangs on the error. It's as if the default error event cannot be supressed on android.

Any help very much appreciated!


Wed Sep 20, 2017 10:06 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.