feat(landing): Add kontakt, datenschutz pages, integrate brevo newsletter and contact, add error-handler
This commit is contained in:
16
landing/server/plugins/error-handler.ts
Normal file
16
landing/server/plugins/error-handler.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { H3Error } from 'h3'
|
||||
|
||||
// Due to a bug in nitro, the stack trace is missing on the server side (https://github.com/nuxt/nuxt/issues/30102)
|
||||
export default defineNitroPlugin((nitroApp) => {
|
||||
nitroApp.hooks.hook('error', (error, { event }) => {
|
||||
const statusCode = (error as H3Error)?.statusCode
|
||||
if (statusCode && statusCode >= 500) {
|
||||
console.error(`[${statusCode}] ${event?.path}`, error)
|
||||
}
|
||||
|
||||
// Print out all errors that are not HTTP errors
|
||||
if (!statusCode) {
|
||||
console.error(`[Error] ${event?.path}`, error)
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user