# Problems with exceptions from JavaScript on iOS

**URL:** <https://forums.fusetools.com/t/problems-with-exceptions-from-javascript-on-ios/3755>\
**Category:** Bug Reports\
**Created:** [March 3, 2016, 10:52pm UTC](https://forums.fusetools.com/t/problems-with-exceptions-from-javascript-on-ios/3755 "2016-03-03T22:52:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [March 3, 2016, 10:52pm UTC](https://forums.fusetools.com/t/problems-with-exceptions-from-javascript-on-ios/3755/1 "2016-03-03T22:52:54Z")

</div>

If I have this JavaScript:

```auto
try {
  myJStestexception.throwit("message");
} catch (e) {
  console.log("message " + e);
}

```

And this code in Uno:

```auto
object ThrowIt(Context c, object[] args) {
    throw new Exception("You suck!");
}

```

This works fine in Fuse Preview, but crashes on iOS.

```auto
$ fuse --version
Fuse version 0.10.0 (build 6023)
Copyright (C) 2016 Fusetools

```

---

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [March 4, 2016, 10:30am UTC](https://forums.fusetools.com/t/problems-with-exceptions-from-javascript-on-ios/3755/2 "2016-03-04T10:30:41Z")

</div>

Based on what @Olle wrote here [https://www.fusetools.com/community/forums/howto\_discussions/throw\_error\_from\_ios\_foreign\_code\_and\_catch\_it\_in](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?

---

<div class="post-metadata">

**Author:** ![Olle\_Fredriksson](https://avatars.discourse-cdn.com/v4/letter/o/e95f7d/32.png) [@Olle\_Fredriksson](https://forums.fusetools.com/u/Olle_Fredriksson)\
**Post date:** [March 4, 2016, 10:38am UTC](https://forums.fusetools.com/t/problems-with-exceptions-from-javascript-on-ios/3755/3 "2016-03-04T10:38:38Z")

</div>

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.
