Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28420] iOS: Unhandled native exceptions invoked via JS should show an error dialog

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2021-06-17T10:06:23.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.1
ComponentsiOS
Labelsexception, ios, parity
ReporterJoshua Quick
AssigneeJoshua Quick
Created2021-04-14T03:29:12.000+0000
Updated2021-06-17T10:06:23.000+0000

Description

*Summary:* When an "unhandled" JavaScript exception occurs, we display an error dialog with a stack trace to make it easy to debug. We need to do the same for native Objective-C and Swift exceptions (ie: thrown NSException objects) which shows both a native stack trace and JavaScript stack trace. Currently, native exceptions are logged and then they immediately hard-crash the app. *Note:* I think this issue might be preventing us from posting native stack traces to our ACA (AMPLIFY Crash Analytics), but I have not confirmed this. *Test:*

Build and run the below code on iOS.

Notice app crashes and goes back to home screen. _(Should show error dialog.)_

Ti.Filesystem.openStream(0, false);

Comments

  1. Joshua Quick 2021-04-14

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12721
  2. Christopher Williams 2021-06-16

    merged to master
  3. Ewan Harris 2021-06-17

    backport merged

JSON Source