Skip to content

Vue.config.errorHandler cannot catch the error thrown by watcher whose user is true in the option if the callback returns a promise #9625

@xixileng

Description

@xixileng

Version

2.6.8

Reproduction link

https://jsfiddle.net/fh5kz3r6/

Steps to reproduce

1.return a promise that reject one error in watch;
2.trigger the watcher in the step 1;

What is expected?

Vue.config.errorHandler can catch the error.

What is actually happening?

Vue.config.errorHandler not catch the error.


I think changing the try {/.../} catch (e) {/.../} in the Vue.prototype.$watch and run function of the watcher to invokeWithErrorHandling can solve the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions