diff --git a/src/app.ts b/src/app.ts index 860e8b9b..57145325 100644 --- a/src/app.ts +++ b/src/app.ts @@ -64,13 +64,12 @@ export function createApp (options: AppOptions = {}): App { error.unhandled = true } - if (error.unhandled || error.fatal) { - console.error('[h3]', error.fatal ? '[fatal]' : '[unhandled]', error) // eslint-disable-line no-console - } - if (options.onError) { await options.onError(error, event) } else { + if (error.unhandled || error.fatal) { + console.error('[h3]', error.fatal ? '[fatal]' : '[unhandled]', error) // eslint-disable-line no-console + } await sendError(event, error, !!options.debug) } }