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

Vue.config.errorHandler called twice when I return a rejected Promise from a handler of a component event #9511

Closed
Labels
Projects

Comments

@jfgodoy
Copy link

jfgodoy commented Feb 17, 2019

Version

2.6.6

Reproduction link

https://codepen.io/anon/pen/qgQYra?editors=1011

Steps to reproduce

The problem seems to happen when I handle an event emitted from a component and return a rejected promise. To see the problem in action, open the codepen link, click the button and you will see in the console two logs of the same error, which means the Vue.config.errorHandler was called twice.

What is expected?

I expect the errrorHandler called once.

What is actually happening?

the errorHandler function is called twice.

@posva posva added the bug label Feb 18, 2019
@yyx990803 yyx990803 added this to To do in Maintenance via automation Feb 18, 2019
@marcus-hiles
Copy link

@jfgodoy try using the async keyword with the promise, and lets see if it works for you.
I have another alternative if it doesn't work though

@jfgodoy
Copy link
Author

jfgodoy commented Feb 19, 2019

hi @marcus-hiles, with async I have the same problem. Only a synchronous throw works

@yyx990803 yyx990803 moved this from To do to In Progress in Maintenance Feb 21, 2019
Maintenance automation moved this from In Progress to Done Feb 21, 2019
yyx990803 pushed a commit that referenced this issue Feb 21, 2019
* fix(#9511): avoid promise catch multiple times

* fix(#9511): add a test case for util/error/invokeWithErrorHandling

* fix(#9511): update test case for util/error/invokeWithErrorHandling
Lostlover pushed a commit to Lostlover/vue that referenced this issue Dec 10, 2019
* fix(vuejs#9511): avoid promise catch multiple times

* fix(vuejs#9511): add a test case for util/error/invokeWithErrorHandling

* fix(vuejs#9511): update test case for util/error/invokeWithErrorHandling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment