forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inspector proxy: catch and report errors in device message handling (f…
…acebook#43697) Summary: Currently, messages from a device are handled by async handlers added to a promise chain. If a handler rejects, the end of the chain becomes a rejected promise, picked up only asynchronously by Metro's global `unhandledRejection` handler. This triggers a warning from Node.js, and worse, prevents any `then()` callback chained by subsequent messages from being invoked at all. Handlers *should* attempt to gracefully deal with errors (as we do with source map fetching errors, for example), but this diff adds a catch-all fallback for anything we might've missed (in this case, a frontend socket disconnecting while we're busy fetching a source map). Errors are caught and logged to EventReporter. **To follow**: Gracefully handle socket disconnections while an async handler is working or queued. Changelog: [General][Fixed] Inspector proxy: prevent errors proxying a device message from blocking the handler queue or spamming logs. Differential Revision: D55482735
- Loading branch information
1 parent
900b0a5
commit ed4cec6
Showing
3 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters