If I have this JavaScript:
try {
myJStestexception.throwit("message");
} catch (e) {
console.log("message " + e);
}
And this code in Uno:
object ThrowIt(Context c, object[] args) {
throw new Exception("You suck!");
}
This works fine in Fuse Preview, but crashes on iOS.
$ fuse --version
Fuse version 0.10.0 (build 6023)
Copyright (C) 2016 Fusetools
Based on what @Olle wrote here https://www.fusetools.com/community/forums/howto_discussions/throw_error_from_ios_foreign_code_and_catch_it_in this is probably a bug in Fuse Preview, that it should not propagate the error to JavaScript?
There is a known inconsistency between the JavaScript engines due to technical limitations: basically we currently have no good way to handle exceptions in an Uno callback from the V8 engine, which is used in preview, so we re-throw all exceptions, whereas on iOS we only re-throw Fuse.Scripting.Error
s. We will try to improve this in the future. You can use Fuse.Scripting.Error
to get consistent behaviour.