nuxt: Global error handler?

I’m using nuxt.js in our production environment, but i can’t find any document about how to capture and analyze exceptions during running asyncData or nuxtServerInit.

I suggest to add options like Vue.config.errorHandler to nuxt.config.js, this will allow us capture exception, inject request id into response

<div align="right">This question is available on Nuxt.js community (#c1512)</div>

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

I don’t understand why this issue is closed? I don’t want to use Sentry. How to handle errors in Nuxt? This is so confusing. I have error that Error template is not catching. You guys can explain how to handle it, please?

Nuxt.js is great.

A single “check how this project does it” line within the API docs, though, is not a good documentation. Please, consider an example within the docs of the (supposedly) simple issue of Handling Errors in SSR, which doesn’t have the inherent distraction (and over-complication) of trying to distil it from a whole project.

Thanks for working on this issue.

You guys are rock!!! Just letting you know, sorry for flood.

I will more than appreciate @DiederikvandenB 😃

ahh like a middleware than can send the thrown exception to bugsnag or sentry. I like the idea 👍 @Meeeeow . There has to be a way to capture after request completed exceptions and send them to sentry as well as handle them at same time to show nice error page etc. using middleware