Skip to content

Cancellation exception is not an error#37

Merged
sprucely merged 1 commit into
mainfrom
swe/ImportDebug
Jul 8, 2026
Merged

Cancellation exception is not an error#37
sprucely merged 1 commit into
mainfrom
swe/ImportDebug

Conversation

@sprucely

@sprucely sprucely commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Improved API request logging to treat client cancellations separately from server errors.
    • Canceled API requests now produce an informational log entry instead of an error, while other API failures continue to be logged as errors.
    • Existing warning logs for API responses with error status codes remain unchanged.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b55a316c-9637-4614-8865-3a769d9f87bf

📥 Commits

Reviewing files that changed from the base of the PR and between a83a721 and b8b5741.

📒 Files selected for processing (1)
  • server/Helpers/LoggingMiddlewareHelper.cs

📝 Walkthrough

Walkthrough

Modifies LoggingMiddlewareHelper.UseApiFailureLogging to catch OperationCanceledException for /api requests canceled by the client, logging an informational message with method, path, and content length, then rethrowing. Other /api failures still logged as errors via the existing handler.

Changes

Middleware Logging Update

Layer / File(s) Summary
Client-cancellation logging for /api requests
server/Helpers/LoggingMiddlewareHelper.cs
Adds a catch for OperationCanceledException when ctx.RequestAborted.IsCancellationRequested is true on /api paths, logging an informational cancellation message before rethrowing, leaving other error handling unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: client cancellation is handled separately and no longer treated as an error for API requests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch swe/ImportDebug

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.

@sprucely sprucely merged commit bc49ed3 into main Jul 8, 2026
5 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.

1 participant