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

errorHandler not catching exceptions in promises with .then() inside v-on #11893

Closed
adamsol opened this issue Jan 27, 2021 · 2 comments
Closed

Comments

@adamsol
Copy link

adamsol commented Jan 27, 2021

Version

2.6.11

Reproduction link

https://jsfiddle.net/adamsol/hj6q32v0/

Steps to reproduce

Click the three buttons.

What is expected?

Exceptions for all the buttons should be captured and displayed below.

What is actually happening?

Exception for the second button isn't captured.


Related to #7653.

I'm using @click="doAction().then(close)" for closing modal windows after successfully finishing async actions. A workaround for exceptions in doAction to be captured by errorHandler is to add () => in the event handler, but it's not obvious.

@posva posva closed this as completed Jan 27, 2021
@adamsol
Copy link
Author

adamsol commented Jan 27, 2021

So why exactly isn't there a return in the generated code in the second case, but there is one in the first case? Is this behaviour documented somewhere?

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

2 participants