Skip to content

feat(client): export HTTPStatusError for typed status code checking#271

Merged
worstell merged 1 commit intomainfrom
worstell/http-status-error
Apr 21, 2026
Merged

feat(client): export HTTPStatusError for typed status code checking#271
worstell merged 1 commit intomainfrom
worstell/http-status-error

Conversation

@worstell
Copy link
Copy Markdown
Contributor

Replaces unstructured errors.Errorf("unexpected status code: %d", ...) with a typed HTTPStatusError struct so callers can use errors.As to inspect the HTTP status code.

This enables consumers (e.g., blox cache priming) to reliably distinguish 403 Forbidden from other failures without fragile string matching.

Replaces unstructured error strings with a typed HTTPStatusError so
callers can use errors.As to inspect the HTTP status code (e.g., to
distinguish 403 Forbidden from other failures).

Amp-Thread-ID: https://ampcode.com/threads/T-019db19f-c22c-7400-bb53-bc30f1034901
Co-authored-by: Amp <[email protected]>
@worstell worstell marked this pull request as ready for review April 21, 2026 20:36
@worstell worstell requested a review from a team as a code owner April 21, 2026 20:36
@worstell worstell requested review from jrobotham-square and removed request for a team April 21, 2026 20:36
@worstell worstell merged commit 8e6e773 into main Apr 21, 2026
8 checks passed
@worstell worstell deleted the worstell/http-status-error branch April 21, 2026 20:40
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.

2 participants