Skip to content

Commit 2e06438

Browse files
committed
return internal error on incoming request failure
1 parent 69e3597 commit 2e06438

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,13 @@ class Server extends EventEmitter<Server.Events> {
8383
this.errors._get(ServerErrorRegistry.ErrorCodes.BAD_URL, null)._send(res, this);
8484
return;
8585
}
86+
8687
if (e instanceof Request.SocketClosedError)
8788
return;
88-
throw e;
89+
90+
this.emit("error", e as any);
91+
this.errors._get(ServerErrorRegistry.ErrorCodes.INTERNAL, null)._send(res, this);
92+
return;
8993
}
9094

9195
for (const [key, value] of this.globalHeaders)

0 commit comments

Comments
 (0)