diff --git a/source/funkin/backend/system/modules/CrashHandler.hx b/source/funkin/backend/system/modules/CrashHandler.hx index 0deef13a..3f64f779 100644 --- a/source/funkin/backend/system/modules/CrashHandler.hx +++ b/source/funkin/backend/system/modules/CrashHandler.hx @@ -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) {