Skip to content

errorHandler not working in Promises / async #7653

Closed
@plehnen

Description

@plehnen

Version

2.5.13

Reproduction link

https://jsfiddle.net/zr7rz6xh/8/

Steps to reproduce

Vue.config.errorHandler = function (err, vm, info) {
alert("handler");
};

new Vue({
el: '#app',
mounted: function() {
return new Promise(function(resolve, reject) {
throw new Error('err');
});
}
})

What is expected?

errorHandler should be called

What is actually happening?

Uncaught (in promise) Error: err


Vue.config.errorHandler is not called if the error occurs inside a promise or await/async function.

I want to use the created hook with an await call, so it has to be async. But then the errorHandler is ignored.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions