3 Replies Latest reply on Apr 12, 2011 12:04 PM by Flex harUI

    Get StackTrace of an error in non-debugging mode

    NikitaL

      Hi,

       

      I have an air application, in which there is a possibility to send logs to support when unhandled exception occured.

       

      I'm adding stackTrace of an error to the log before sending them.

       

      When the app is launched from Flex Builder everything works fine, but when the app was installed on the machine I get null instead of the stackTrace

       

      There is some code

       

      private function app_complete(e : Event) : void
      {
           ...
           loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, app_UncaughtError);
           ...
      }
      
      private function app_UncaughtError(event : UncaughtErrorEvent) : void
      {
           var message : String;
           if (event.error is Error)
                message = (event.error as Error).getStackTrace();
           ...
           sendLog(message);
      }
      

       

       

      I know that the getStackTrace method is for debug versions only, and it returns null in non-debugging mode. But I realy need to get StackTrace in non-debugging mode. Maybe there a way to make this method return not null value. Or maybe someone knows another way?