Commit 84d5230dc300e5523a7e176cfd37ccfc7bfe7ff5
ux: improve crash detection and reporting
Andre Staltz committed on 10/31/2019, 8:35:47 PMParent: f3225b817c0dc3939d484304759046d177a57fe5
Files changed
src/backend/loader.ts | changed |
src/backend/loader.ts | ||
---|---|---|
@@ -17,8 +17,15 @@ | ||
17 | 17 | process.env = process.env || {}; |
18 | 18 | // process.env.CHLORIDE_JS = 'yes'; |
19 | 19 | |
20 | 20 | // Report JS backend crashes to Java, and in turn, to ACRA |
21 | +process.on('unhandledRejection', (reason, _promise) => { | |
22 | + rnBridge.channel.post('exception', reason); | |
23 | + console.error(reason); | |
24 | + setTimeout(() => { | |
25 | + process.exit(1); | |
26 | + }); | |
27 | +}); | |
21 | 28 | process.on('uncaughtException', err => { |
22 | 29 | if (typeof err === 'string') { |
23 | 30 | rnBridge.channel.post('exception', err); |
24 | 31 | } else { |
Built with git-ssb-web