Skip to content

Stop throwing on non-ok HTTP responses#6

Closed
sbornia wants to merge 1 commit into
mainfrom
return-error-responses
Closed

Stop throwing on non-ok HTTP responses#6
sbornia wants to merge 1 commit into
mainfrom
return-error-responses

Conversation

@sbornia

@sbornia sbornia commented Feb 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove UpvioApiRequestError throw from request() on non-ok status codes — error responses are now returned as parsed JSON, letting callers inspect API error payloads directly
  • Update tests in request.test.ts and scans.test.ts to assert returned error bodies instead of expecting thrown exceptions

Test plan

  • tsc --noEmit passes
  • 24 tests pass (vitest run)
  • biome check reports no issues

Return parsed JSON for all responses instead of throwing
UpvioApiRequestError on non-ok status codes. This lets callers
inspect error payloads from the API directly.

Update tests in request.test.ts and scans.test.ts to assert
returned error bodies instead of expecting thrown exceptions.
@sbornia sbornia self-assigned this Feb 24, 2026
@sbornia sbornia closed this Feb 24, 2026
@sbornia
sbornia deleted the return-error-responses branch February 24, 2026 17:01
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