titanium-sdk
titanium-sdk copied to clipboard
Android: Add support for onunhandledrejection event
I have searched and made sure there are no existing issues for the issue I am filing
- [X] I have searched the existing issues
Description
If a JavaScript promise that has no rejection handler is rejected, the unhandledrejection event is sent to the global scope. Handling unhandledrejection event is currently only supported for iOS, but should be supported on Android as well, as this is useful for debugging and for providing fallback error handling for unexpected situations.
Solution
//Add support for this on Android
global['onunhandledrejection'] = function(reason, promise){
}
Alternatives
No response
Platforms
Android
A small addition: there is an old jira ticket with some infos and an example: https://jira-archive.titaniumsdk.com/TIMOB/TIMOB-27926 Might be useful