Skip to content

Commit

Permalink
fix(renderer): do not use default error fallback
Browse files Browse the repository at this point in the history
it overrides user provided error handler!
  • Loading branch information
pi0 committed Aug 12, 2022
1 parent 25f6ace commit 80081b0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/runtime/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export function defineRenderHandler (handler: RenderHandler) {
return
}

const response = await Promise.resolve(handler(event)).catch(async (err) => {
const defaultErrorHandler = await import('./error').then(r => r.default)
await defaultErrorHandler(err, event)
})
const response = await handler(event)
if (!response) {
if (!event.res.writableEnded) {
event.res.statusCode = event.res.statusCode === 200 ? 500 : event.res.statusCode
Expand Down

0 comments on commit 80081b0

Please sign in to comment.