Skip to content

Commit

Permalink
fix: don not log errors when onError is provided (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Aug 10, 2022
1 parent a8fa857 commit ccc9c7e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit ccc9c7e

Please sign in to comment.