From a454ba0131de8ce2103aff4e60302bf28db895bc Mon Sep 17 00:00:00 2001 From: "Miss Circle (Moxie)" <124418090+moxie-coder@users.noreply.github.com> Date: Fri, 2 Aug 2024 09:51:49 -0400 Subject: [PATCH] sorry @JordanSantiagoYT this should help with the no error messages hopefully (untested since I don't really have a way to test it, but it was on another repo I tested) --- source/Main.hx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/Main.hx b/source/Main.hx index 5c288f0f..6b208997 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -153,6 +153,9 @@ class Main extends Sprite { #if CRASH_HANDLER Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onCrash); + #if cpp + untyped __global__.__hxcpp_set_critical_error_handler(onError); + #end #end #if DISCORD_ALLOWED DiscordClient.prepare(); #end @@ -224,4 +227,11 @@ class Main extends Sprite { Sys.exit(1); } #end + + #if cpp + private static function onError(message:Dynamic):Void + { + throw Std.string(message); + } + #end }