Skip to content

Say what a non-JSON credentials response actually contained - #1545

Merged
adamtheturtle merged 1 commit into
mainfrom
adamtheturtle/vws-web-tools-issue-1503
Aug 27, 2026
Merged

Say what a non-JSON credentials response actually contained#1545
adamtheturtle merged 1 commit into
mainfrom
adamtheturtle/vws-web-tools-issue-1503

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

Closes #1503.

Anything response.json() cannot parse produced the same sentence: "The Vuforia credentials response had an unexpected shape." That reads as "the JSON was not the shape we expected", but it also fires for a 200 carrying an HTML sign-in page — the most likely real cause, since these calls authenticate with cookies scraped from the browser and an expired session gets an HTML redirect, not JSON. Somebody debugging that is told the wrong thing and has nothing to go on.

The message now names the URL, the status code, the content type, and the first 500 characters of the body — the same excerpt length _request already uses for HTTP errors.

test_json_request_raises_runtime_error_for_invalid_json now sends an HTML body and asserts the whole message.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM

Closes #1503

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM
@adamtheturtle
adamtheturtle merged commit 50a458e into main Aug 27, 2026
29 checks passed
@adamtheturtle
adamtheturtle deleted the adamtheturtle/vws-web-tools-issue-1503 branch August 27, 2026 06:21
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.

_json_request error message unexpected shape also used for non-JSON 200 responses

1 participant