Vue.js 3's alternative to `Vue.config.errorHandler`
Asked Answered
E

1

13

Airbrake's Vue configuration page is still about Vue 2:

Vue.config.errorHandler = function (err, vm, info) {
  airbrake.notify({
    error: err,
    params: {info: info}
  });
}

What is the equivalent for Vue.js 3?

Embrace answered 6/9, 2020 at 19:14 Comment(0)
Y
25

It's the same in vue 3 with a little change which is the use of Vue instead (instance of createApp()) instance of Vue class :

import { createApp } from "vue";
import App from "./App.vue";

let app=createApp(App)

app.config.errorHandler = function (err, vm, info) {
  airbrake.notify({
    error: err,
    params: {info: info}
  });
}
app.mount("#app");

Yeanling answered 6/9, 2020 at 22:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.