Skip to content

fix: store correct status code for unhandled exceptions#14

Merged
georgidhristov merged 1 commit into
masterfrom
fix/incorrect-500-status-storage
May 10, 2026
Merged

fix: store correct status code for unhandled exceptions#14
georgidhristov merged 1 commit into
masterfrom
fix/incorrect-500-status-storage

Conversation

@georgidhristov
Copy link
Copy Markdown
Collaborator

Closes #9

Summary

Fixes incorrect 200 status codes being stored for requests ending with unhandled exceptions.

Changes

  • Detect unhandled exceptions inside middleware
  • Force status code to 500 when exception occurs and response status is still 200
  • Preserve actual status code when already updated by exception middleware

Result

Requests ending with unhandled exceptions are now stored with the correct final status code.

@georgidhristov georgidhristov merged commit 168f94a into master May 10, 2026
@georgidhristov georgidhristov deleted the fix/incorrect-500-status-storage branch May 10, 2026 07:08
@georgidhristov georgidhristov added bug Something isn't working middleware HTTP pipeline and middleware related issues labels May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working middleware HTTP pipeline and middleware related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled exception requests (500) may be stored with incorrect 200 status code

1 participant