N
Nuxt3y ago
cosbgn

How to add a server error handler?

Is there a way to add a nitro plugin which can simply console log everytime I either throw createError() or the app has any other error (500) ?
2 Replies
Likonima
Likonima2y ago
I think you can do this in the context. Im not into this but u may wanna try around https://nuxt.com/docs/getting-started/error-handling#error-handling
Nuxt
Error handling · Get Started with Nuxt
Learn how to catch errors in different lifecycle.
cosbgn
cosbgnOP2y ago
Hi @Likonima yes that's why I am asking, the docs state:
Errors During API or Nitro Server Lifecycle
You cannot currently define a server-side handler for these errors
Errors During API or Nitro Server Lifecycle
You cannot currently define a server-side handler for these errors
I was hoping that the docs were outdated or that there would be a workaround by now
Want results from more Discord servers?
Add your server