mit-cml / appinventor-sources

MIT App Inventor Public Open Source
http://appinventor.mit.edu/appinventor-sources/
Apache License 2.0
1.5k stars 2.08k forks source link

Implement a default uncaught exception handler #3254

Closed ewpatton closed 2 weeks ago

ewpatton commented 3 weeks ago

Change-Id: Icb5517fad7968978e2a21a4de6078d1407308829

General items:

If your code changes how something works on the device (i.e., it affects the companion):

Further, if you've changed the blocks language or another user-facing designer/blocks API (added a SimpleProperty, etc.):

For all other changes:

What does this PR accomplish?

Description

Fixes #3179 by setting a custom handler for when threads throw uncaught exceptions. Note that the behavior is different between Form and ReplForm, where the latter reports errors back to the editor via RetValManager.

ewpatton commented 3 weeks ago

@jisqyv Here is a test app with an extension that just throws an error on another thread using AsynchUtil.

ExceptionTester.aia.zip