Skip to content

Show the Browser API's error body instead of a bare HTTP status - #7

Merged
jehrr merged 1 commit into
mainfrom
fix/show-api-error-body-2026-10-16
Oct 16, 2026
Merged

jehrr merged 1 commit into
mainfrom
fix/show-api-error-body-2026-10-16

Conversation

@jehrr

@jehrr jehrr commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

The canary's endpoint step failed with only 404 Client Error: Not Found for url: https://api.2captcha.com/browser/connection. _call ran raise_for_status(), which drops the response body — and the body is where the Browser API names the cause (ERROR_ACCOUNT_NOT_FOUND, ERROR_CUSTOM_PROXY_AUTH, …).

Now an HTTP error prints HTTP <status>: <body> with the body passed through the existing safe() masker and redact(), so key, password and login fields stay masked; a non-JSON body is reported by size only.

Checked offline with a stubbed requests: a 404 JSON body shows its errorCode with key/password masked; a non-JSON body prints only its length; a 200 still returns the data. smoke_test.py 684/0, pytest 94 passed, ci_checks.py --all clean (core-only venv).

🤖 Generated with Claude Code

https://claude.ai/code/session_01CKsd7q25N19WzUZjrAdzx8

@jehrr
jehrr merged commit 1ed4e9c into main Oct 16, 2026
7 checks passed
@jehrr jehrr mentioned this pull request Oct 16, 2026
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