-
Notifications
You must be signed in to change notification settings - Fork 32
🐛 web-api: Fixes handling of unexpected errors #7939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 web-api: Fixes handling of unexpected errors #7939
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7939 +/- ##
==========================================
Coverage 87.90% 87.90%
==========================================
Files 1846 1428 -418
Lines 71225 59370 -11855
Branches 1220 621 -599
==========================================
- Hits 62609 52190 -10419
+ Misses 8264 6969 -1295
+ Partials 352 211 -141
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR standardizes error handling by removing the skip_internal_error_details toggle, ensuring internal exceptions never leak raw details, and cleans up related middleware code.
- Dropped the
skip_internal_error_detailsparameter fromcreate_http_errorand simplified its logic. - Updated middlewares to stop branching on environment flags and renamed variables for consistency.
- Adjusted tests to remove obsolete
skip_detailsparameter.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/service-library/tests/aiohttp/test_rest_responses.py | Removed the obsolete skip_details parameter and related invocations in tests_exception_to_response. |
| packages/service-library/src/servicelib/aiohttp/rest_responses.py | Removed the skip_internal_error_details parameter and simplified the internal-error branch. |
| packages/service-library/src/servicelib/aiohttp/rest_middlewares.py | Removed environment-based detail toggles, introduced a single error_message variable, and renamed resp to response. |
| packages/service-library/src/servicelib/aiohttp/monitoring.py | Renamed resp to response, removed default reason text, and dropped special cases for cancelled/HTTPServerError. |
Comments suppressed due to low confidence (1)
packages/service-library/src/servicelib/aiohttp/rest_responses.py:88
- The docstring references skipping internal error details, but the
skip_internal_error_detailsparameter was removed; update the documentation to reflect the current behavior.
exceptions to the client in production
packages/service-library/src/servicelib/aiohttp/rest_middlewares.py
Outdated
Show resolved
Hide resolved
matusdrobuliak66
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
sanderegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
bisgaard-itis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix
4b494c4 to
8ac1c97
Compare
|
@mergify queue |
🟠 Waiting for conditions to match
|
|
@mergify queue |
🛑 The pull request could not be mergedThis could be related to an activated branch protection or ruleset rule that prevents us from merging. (details: 3 of 6 required status checks are expected.) |
…ioritize exception text
…upport ID logging
…ency in HTTP responses
89dcb0d to
68bb19c
Compare
|
|
This pull request has been removed from the queue for the following reason: Pull request #7939 has been dequeued. The pull request could not be merged. This could be related to an activated branch protection or ruleset rule that prevents us from merging. (details: 3 of 6 required status checks are expected.). You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. |
|
@mergify queue |
🛑 The pull request has been removed from the queue
|



What do these changes do?
Avoid including the string representation of raw exceptions in HTTP responses:
Related issue/s
How to test
Dev-ops
None