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
- onErrorCaptured Lifecycle Hook
- Error Boundary Components
- app.config.errorHandler for Global Errors
- Async Error Handling in Composables