Skip to content

Commit b57e8af

Browse files
authored
fix(node): Avoid catching domain errors in request handler (#5627)
According to the Node.js docs, domain errors are equivalent to an uncaught exception and therefore should not really be caught except to do some cleanup and then exit the process. Not doing so causes the process to potentially linger without being able to handle any request. Currently, the behaviour is also erroneous because `next` can end up be called twice.
1 parent 14a7a45 commit b57e8af

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

packages/node/src/handlers.ts

-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ export function requestHandler(
153153
const local = domain.create();
154154
local.add(req);
155155
local.add(res);
156-
local.on('error', next);
157156

158157
local.run(() => {
159158
const currentHub = getCurrentHub();

0 commit comments

Comments
 (0)