RouteRegistry.handleException() logs client disconnects as "Unhandled route error"
When a client aborts a request mid-body, BodyParser rejects with "Connection aborted". RouteRegistry.executeHandler() catches this and calls handleException(), which logs it as an error:
Unhandled route error: Error: Connection aborted
A client disconnect is an expected network event, not an unhandled server error. This creates false-positive ERROR-level noise in logs.
Current behavior
handleException() then tries to send a 500 response, but UwsResponse.send() short-circuits because this.aborted = true. So the log is pure noise, no response is sent, no crash occurs.
Suggested Fix
In RouteRegistry.handleException(), check if the error is a connection abort and treat it as a clean disconnect:
private handleException(error: Error, ...): void {
// Skip logging for expected client disconnects
if (error.message === 'Connection aborted') {
return;
}
this.logger.error('Unhandled route error:', error);
// ...
}
RouteRegistry.handleException()logs client disconnects as "Unhandled route error"When a client aborts a request mid-body,
BodyParserrejects with"Connection aborted".RouteRegistry.executeHandler()catches this and callshandleException(), which logs it as an error:A client disconnect is an expected network event, not an unhandled server error. This creates false-positive ERROR-level noise in logs.
Current behavior
handleException()then tries to send a 500 response, butUwsResponse.send()short-circuits becausethis.aborted = true. So the log is pure noise, no response is sent, no crash occurs.Suggested Fix
In
RouteRegistry.handleException(), check if the error is a connection abort and treat it as a clean disconnect: