Skip to content

Commit

Permalink
fix: skip built-in error handler if onError provided
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 31, 2022
1 parent 1552219 commit 2c25aa1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ export function createApp (options: AppOptions = {}): App {
} catch (err) {
if (options.onError) {
await options.onError(err as Error, event)
} else {
if (!isError(err)) {
console.error('[h3]', err) // eslint-disable-line no-console
}
await sendError(event, err as Error, !!options.debug)
}
if (!isError(err)) {
console.error('[h3]', err) // eslint-disable-line no-console
}
await sendError(event, err as Error, !!options.debug)
}
}

Expand Down

0 comments on commit 2c25aa1

Please sign in to comment.