-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance/fix error reporting in reload and destroy
Summary: The new reload/create/destroy methods work by chaining tasks together. This task chain has the type Task<ReactInstance>. **The problem:** If any step in the chain fails, task.getResult() actually returns null - not the ReactInstance. Many steps in the existing reload() and destroy() task chains don't account for this case. So: - The reload() and destroy() task chains sometimes swallow errors. - Sometimes steps in the reload() and destroy() task chains don't execute: they use .successTask This diff makes two changes: 1. Ensure each step **always** executes (i.e: use .continueWith vs .success) 2. Ensure each step first checks if the Task<ReactInstance> isn't faulted/cancelled. If the task is faulted/cancelled, a soft exception gets reported, and the current ReactInstance gets returned. Changelog: [Internal Reviewed By: mdvacca Differential Revision: D48080779 fbshipit-source-id: 22f03ef1a54b538d01eeb5ecde6d82a84d32f1f8
- Loading branch information
1 parent
1f0094e
commit f437224
Showing
2 changed files
with
134 additions
and
55 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