0Pricing
Vue Academy · Lesson

app.config.errorHandler for Global Errors

Global error handler, logging to Sentry/Datadog, environment-aware error display.

The Global Error Handler

Vue exposes app.config.errorHandler, a single function that catches errors from anywhere in the app that were not handled locally. It is your last line of defense.

The Handler Signature

It receives the same three arguments as onErrorCaptured: the error, the component instance, and an info string.

app.config.errorHandler = (err, instance, info) => {
  // global handling
};

All lessons in this course

  1. onErrorCaptured Lifecycle Hook
  2. Error Boundary Components
  3. app.config.errorHandler for Global Errors
  4. Async Error Handling in Composables
← Back to Vue Academy