Skip to content

Commit

Permalink
fix(app): use default error handler of onError does not handle reponse
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 1, 2023
1 parent 6e58103 commit 8189a42
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ export function toNodeListener(app: App): NodeListener {

if (app.options.onError) {
await app.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, !!app.options.debug);
}
if (event.handled) {
return;
}

Check warning on line 70 in src/node.ts

View check run for this annotation

Codecov / codecov/patch

src/node.ts#L69-L70

Added lines #L69 - L70 were not covered by tests
if (error.unhandled || error.fatal) {
console.error("[h3]", error.fatal ? "[fatal]" : "[unhandled]", error); // eslint-disable-line no-console
}
await sendError(event, error, !!app.options.debug);
}
};
return toNodeHandle;
Expand Down

0 comments on commit 8189a42

Please sign in to comment.