Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (android): global UnhandledRejection redirector to JSDialogError and uncaughtException handler #14182

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

Informate
Copy link

@Informate Informate commented Feb 11, 2025

GitHub Issues: #14177

Optional Description:

The unhandledRejection V8 event is unhandled by Titanium SDK at the moment, and the unhandledRejections event get silently lost.

This commit fixes the issue handling the V8 event and sending it from V8Runtime to the JS environment thorw Kroll with just few changes and modify.

The JS Error Dialog shows correctly and the Rejected Promises can now be cacthed by uncaughtException as an exception with type='Rejected Promise' (still not a Ti.App unhandledRejection event).

Code Example:

Ti.App.addEventListener('uncaughtException',(err)=>console.error(err));
(async ()=>{
  throw new Error("Show me this ERROR !!!!");
})();

@Informate Informate changed the title [14177] Global UnhandledRejection redirector to JSDialogError and uncaughrException handler [14177] Global UnhandledRejection redirector to JSDialogError and uncaughtException handler Feb 11, 2025
@Informate Informate changed the title [14177] Global UnhandledRejection redirector to JSDialogError and uncaughtException handler [14177] Android: Global UnhandledRejection redirector to JSDialogError and uncaughtException handler Feb 11, 2025
@m1ga
Copy link
Contributor

m1ga commented Feb 11, 2025

Please check https://www.fromzerotoapp.com/extending-titanium-sdk/#link9 and rename the title according to it. This should be a feat(andorid).... and make sure to add the example code to test it in the description.

@Informate Informate changed the title [14177] Android: Global UnhandledRejection redirector to JSDialogError and uncaughtException handler Feat (Android): Global UnhandledRejection redirector to JSDialogError and uncaughtException handler Feb 13, 2025
@Informate
Copy link
Author

Please check https://www.fromzerotoapp.com/extending-titanium-sdk/#link9 and rename the title according to it. This should be a feat(andorid).... and make sure to add the example code to test it in the description.

Renamed! There something more I have to do? Need to resubmit the PR or not?

@m1ga m1ga changed the title Feat (Android): Global UnhandledRejection redirector to JSDialogError and uncaughtException handler feat (android): global UnhandledRejection redirector to JSDialogError and uncaughtException handler Feb 13, 2025
@m1ga
Copy link
Contributor

m1ga commented Feb 13, 2025

@Informate no, you don't need to resubmit it.

Please add the code example to the first post (edit it) so people know how to test it.

@Informate
Copy link
Author

@Informate no, you don't need to resubmit it.

Please add the code example to the first post (edit it) so people know how to test it.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants