diff --git a/src/main/hw/log/BaseLogger.hx b/src/main/hw/log/BaseLogger.hx index 4989979..36f1825 100755 --- a/src/main/hw/log/BaseLogger.hx +++ b/src/main/hw/log/BaseLogger.hx @@ -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)}'); } }