I am writing UI of an application using Haxe for CPP targets. I need to intercept haxe error/exceptions before it crashes the App.
Below is an example of code which crashes the application:
@:final private function callFoo(classA : IInterface) : Void
{
if ((mClassLevelVariable != null) && (classA != mClassLevelVariable))
{
throw new Error("Can not work with " + Type.getClassName(Type.getClass((classA))));
}
}
I need to intercept the crash before error like given above crashes the application. Do we have any support in Haxe like Java provides Thread.UncaughtExceptionHandler
?