mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-05 11:57:13 +00:00
13 lines
418 B
TypeScript
13 lines
418 B
TypeScript
export default defineNitroPlugin((nitroApp) => {
|
|
if (!import.meta.dev) { return }
|
|
|
|
const onError = nitroApp.h3App.options.onError!
|
|
nitroApp.h3App.options.onError = (error, event) => {
|
|
// TODO: somehow add error logging assertion to @nuxt/test-utils
|
|
if (error.message?.includes('Cannot set headers after they are sent to the client')) {
|
|
process.exit(1)
|
|
}
|
|
return onError(error, event)
|
|
}
|
|
})
|