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

errorCaptured and errorHandler should capture errors in v-on handlers #6953

Closed
Toilal opened this Issue Oct 29, 2017 · 5 comments

Comments

Projects
5 participants
@Toilal
Copy link

Toilal commented Oct 29, 2017

Version

2.5.2

Reproduction link

https://codesandbox.io/s/k9rlpoojpr

Steps to reproduce

Click on throw error button in reproduction link

What is expected?

This should display an alert with error object, handled by errorCaptured hook defined in App.vue component.

What is actually happening?

The errorCaptured hook is not invoked


It seems that typings in options.d.ts is not the same as specified in the docs too.

errorCaptured?(): boolean | void;

https://vuejs.org/v2/api/#errorCaptured

@yyx990803

This comment has been minimized.

Copy link
Member

yyx990803 commented Oct 30, 2017

We currently only capture errors in the following:

  • render functions
  • watcher callbacks
  • lifecycle hooks
  • component event handlers

DOM event handlers are currently not included and probably should.

@yyx990803 yyx990803 changed the title errorCaptured hook doesn't work errorCaptured and errorHandler should capture errors in v-on handlers Oct 30, 2017

@TheDeveloperTom

This comment has been minimized.

Copy link

TheDeveloperTom commented Apr 30, 2018

What’s the status?

enkot added a commit to enkot/vue that referenced this issue Jun 30, 2018

Merge pull request #1 from coldino/extended-async-handling
Add handling for v-on normal+async errors (vuejs#6953)
@stalniy

This comment has been minimized.

Copy link

stalniy commented Sep 12, 2018

Are there any plans to fix this?

@rightaway

This comment has been minimized.

Copy link

rightaway commented Oct 9, 2018

I'm using vuex to track where the error might have come from to display the error the right way but it's error prone, this feature would remove the need for that.

@yyx990803 yyx990803 added this to Todo in 2.6 via automation Dec 6, 2018

@yyx990803 yyx990803 moved this from Todo to In progress in 2.6 Dec 6, 2018

yyx990803 added a commit that referenced this issue Dec 20, 2018

@yyx990803

This comment has been minimized.

Copy link
Member

yyx990803 commented Dec 20, 2018

Closed via #8395 (will be out 2.6)

@yyx990803 yyx990803 closed this Dec 20, 2018

2.6 automation moved this from In progress to Done Dec 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment