Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for promise rejection tracking
Summary: Adds support for tracking unhandled rejections with `console.warn` (= yellow box). I will create a follow-up with proper error stack formatting. related: #4971 fixes: #4045, #4142 public {F59857438} {F59857439} Reviewed By: bestander Differential Revision: D2803126 fb-gh-sync-id: 376b33e42a967675a04338cbff3ec315a77d1037
- Loading branch information
b064094
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OH MY GOD. Thank you!
b064094
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This slays.
b064094
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this.
is there a way to global catch this? instead of console.error. I was trying to use
ErrorUtils.setGlobalHandler()
b064094
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
ErrorUtils.reportError
should be called for unhandled promise errors.b064094
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will definitely make this configurable.
b064094
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidaurelio as of now are we able to catch globally unhandled promise rejections?
This feature is handy to report errors to tools like Sentry. Also what is ErrorUtils, this seems undocumented anywhere?
See also #2585 (comment)