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

The promise reject doesn't really make sense... #38

Open
nicroto opened this issue Jul 29, 2018 · 3 comments
Open

The promise reject doesn't really make sense... #38

nicroto opened this issue Jul 29, 2018 · 3 comments

Comments

@nicroto
Copy link

nicroto commented Jul 29, 2018

Especially when you use the dialog from an async function - you will have to make the call inside of a try-catch block or you get a false error within the console when you cancel the confirm operation (because of the unhandled reject call).

@Godofbrowser
Copy link
Owner

That's correct... Do you have any idea how this can be improved? I'm thinking of resolving the promise with a property that takes the value false on rejection instead of rejecting the promise... Do let me know if you have a better idea.

Thanks

@superbiche
Copy link

I think it's the correct way as it correspond to what the user did: say "false" to the question prompted.

@paddotk
Copy link

paddotk commented Oct 14, 2021

What is the reason the promise rejects with false? It seems to me that you'd reject a promise with either nothing or an error object. If it's not necessary, I'd suggest to remove the false from the rejection so we don't get a warning about an unhandled promise rejection.

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

No branches or pull requests

4 participants