Skip to content

Noisy Abort Logs #163

@VikramAditya33

Description

@VikramAditya33

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);
  // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions