Skip to content

Handle non-string error values in error responses - #172

Merged
RazerM merged 1 commit into
mainfrom
feature/error-message
Aug 23, 2026
Merged

Handle non-string error values in error responses#172
RazerM merged 1 commit into
mainfrom
feature/error-message

Conversation

@RazerM

@RazerM RazerM commented Aug 22, 2026

Copy link
Copy Markdown
Member

Only set the Space-Track error message from the JSON 'error' value when
it is a string; anything else falls back to showing the raw response
body. A truthy non-string value previously raised TypeError from the
message concatenation instead of the intended HTTPStatusError, so
callers catching HTTPStatusError missed the failure. No such response
has been observed from Space-Track; this is defensive hardening of the
error reporting path.

@RazerM RazerM changed the title Only use string error values in _raise_for_status Handle non-string error values in error responses Aug 22, 2026
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.31%. Comparing base (168de31) to head (18ab5c0).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #172      +/-   ##
==========================================
+ Coverage   96.33%   98.31%   +1.97%     
==========================================
  Files           7        7              
  Lines        1147     1304     +157     
  Branches      129      135       +6     
==========================================
+ Hits         1105     1282     +177     
+ Misses         25       12      -13     
+ Partials       17       10       -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RazerM
RazerM force-pushed the feature/error-message branch 4 times, most recently from baefb59 to 85a08fb Compare August 23, 2026 13:45
Only set the Space-Track error message from the JSON 'error' value when
it is a string; anything else falls back to showing the raw response
body. A truthy non-string value previously raised TypeError from the
message concatenation instead of the intended HTTPStatusError, so
callers catching HTTPStatusError missed the failure. No such response
has been observed from Space-Track; this is defensive hardening of the
error reporting path.
@RazerM
RazerM force-pushed the feature/error-message branch from 85a08fb to 18ab5c0 Compare August 23, 2026 14:09
@RazerM
RazerM merged commit febc1ff into main Aug 23, 2026
11 checks passed
@RazerM
RazerM deleted the feature/error-message branch August 23, 2026 19:00
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