Skip to content

fix: suppress false-positive ERROR log on client-abort in handleException#165

Merged
VikramAditya33 merged 1 commit into
FOSSFORGE:mainfrom
jesustorres-code:fix/silent-abort-logs
May 18, 2026
Merged

fix: suppress false-positive ERROR log on client-abort in handleException#165
VikramAditya33 merged 1 commit into
FOSSFORGE:mainfrom
jesustorres-code:fix/silent-abort-logs

Conversation

@jesustorres-code
Copy link
Copy Markdown

Problem

When a client disconnects mid-request, BodyParser rejects with "Connection aborted". RouteRegistry.executeHandler() catches this and calls handleException(), which was logging it as an unhandled server error:

Unhandled route error: Error: Connection aborted

Then it tried to send a 500 response, which UwsResponse.send() silently dropped because this.aborted was already true. So the log was pure noise — no response was sent, no crash occurred, nothing needed to be "handled."

Fix

Add an early-return guard at the top of handleException():

if (res.isAborted || error.message === 'Connection aborted') {
  return;
}

This matches the pattern already used throughout the rest of the file (e.g. lines 279, 322–325, 373, 956, 967) for the aborted state.

Test

Added a regression test to route-registry.spec.ts that verifies logger.error is not called when the handler rejects with "Connection aborted".

All 948 existing tests still pass.

Closes #163

…tion

When a client disconnects mid-request, BodyParser rejects with
"Connection aborted". RouteRegistry.executeHandler() catches this and
calls handleException(), which was logging it as an unhandled server
error and attempting a 500 response (which UwsResponse silently
dropped because res.aborted was already true).

A client disconnect is an expected network event, not a server fault.
Fix: add an early-return guard at the top of handleException() that
silently exits when res.isAborted is set or the error message is
"Connection aborted", matching the pattern already used throughout
the rest of the file for the aborted state.

Adds a regression test that verifies logger.error is NOT called for
Connection aborted errors.

Closes FOSSFORGE#163

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b5d9a6b8-4d4f-4a53-ac68-e6de6c12a0e0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@VikramAditya33 VikramAditya33 self-requested a review May 18, 2026 12:13
Copy link
Copy Markdown
Collaborator

@VikramAditya33 VikramAditya33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thank you

@VikramAditya33 VikramAditya33 merged commit 1991cb6 into FOSSFORGE:main May 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Noisy Abort Logs

3 participants