Improve the crash handler

Co-Authored-By: Mihai Alexandru <77043862+majigsaw77@users.noreply.github.com>
This commit is contained in:
NeeEoo
2023-07-28 20:22:56 +02:00
co-authored by Mihai Alexandru
parent 0eebc9d9f8
commit 883b2f2b3c
@@ -12,6 +12,11 @@ import haxe.CallStack;
class CrashHandler {
public static function init() {
Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onError);
#if cpp
untyped __global__.__hxcpp_set_critical_error_handler(onError);
#elseif hl
Api.setErrorHandler(onError);
#end
}
public static function onError(e:UncaughtErrorEvent) {