[log] fix error stack on flash platform
This commit is contained in:
@@ -20,8 +20,17 @@ class LoggerUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static function getErrorStack(error:Dynamic):String {
|
||||
#if flash
|
||||
if (Std.is(error, flash.errors.Error)) {
|
||||
return cast(error, flash.errors.Error).getStackTrace();
|
||||
}
|
||||
#end
|
||||
return CallStack.exceptionStack().map(printStackItem).join('\n\t');
|
||||
}
|
||||
|
||||
public static function printError(error:Dynamic):String {
|
||||
return error == null ? '' : Std.string('${error}\n\t${CallStack.exceptionStack().map(printStackItem).join('\n\t')}');
|
||||
return error == null ? '' : Std.string('${error}\n\t${getErrorStack(error)}');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user