-1

我在获取错误堆栈跟踪时遇到问题。当我在调试播放器中使用 error.getStackTrace() 时,它工作正常。

ReferenceError: Error #1056: Не удается создать свойство asdad в starling.display.Stage. at app.views::MachineHeader/onSoundButtonTriggered() 
 [/var/lib/jenkins/jobs/.../src/app/views/MachineHeader.as:111] at starling.events::EventDispatcher/invokeEvent()
[/var/lib/jenkins/jobs/.../workspace/src/starling/events/EventDispatcher.as:141] at starling.events::EventDispatcher/dispatchEvent()
[/var/lib/jenkins/jobs/.../workspace/src/starling/events/EventDispatcher.as:112] at starling.events::EventDispatcher/dispatchEventWith()
[/var/lib/jenkins/jobs/.../workspace/src/starling/events/EventDispatcher.as:190] at org.feathers.controls::Button/button_touchHandler()
[/var/lib/jenkins/jobs/.../workspace/src/org/feathers/controls/Button.as:3052] at starling.events::EventDispatcher/invokeEvent()
[/var/lib/jenkins/jobs/.../workspace/src/starling/events/EventDispatcher.as:141] at starling.events::TouchEvent/dispatch()
[/var/lib/jenkins/jobs/.../workspace/src/starling/events/TouchEvent.as:174] at starling.events::Touch/dispatchEvent()
[/var/lib/jenkins/jobs/.../workspace/src/starling/events/Touch.as:231]

但在发布播放器 stackTrace 看起来像:

ReferenceError: Error #1056

代码:

this.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onGlobalErrorsHandler);

private function onGlobalErrorsHandler(e:UncaughtErrorEvent):void {
    if (_errorList[e.errorID]) {
        e.preventDefault();
        return;
    }

    trace(e.error.getStackTrace());
    var data:Object = {};
    data["login"] = AMFService.instance.login;
    data["error_type"] = String(e.error.errorID);
    data["stacktrace"] = e.error.getStackTrace();
    AMFService.instance.sendError("statistics.error_send", data);

    _errorList[e.errorID] = e.error;

    e.preventDefault();
}

调试播放器:Linux 11.2 发布播放器:PepperFlash 11.9

我做错了什么?如何在发布播放器上获取堆栈跟踪?

比你。

4

2 回答 2

3

要在发布播放器(11.5+)中启用堆栈跟踪,您必须使用 swf-version=18 编译您的 swf

http://www.adobe.com/devnet/articles/flashplayer-air-feature-list.html

于 2013-11-06T16:16:21.220 回答
2

根据 Adob​​e 对Error.getStackTrace()的 API 参考...

“对于 Flash Player 11.4 及更早版本和 AIR 3.4 及更早版本,堆栈跟踪仅在代码在 Flash Player 的调试器版本或 AIR 调试启动器 (ADL) 中运行时可用。在这些运行时的非调试器版本中,调用此方法返回空值。”

对不起,但没有办法解决它。:(

于 2013-11-06T04:31:37.897 回答