Skip to content

Add test on receiving an invalid JSON in the APIError exception handler. - #1512

Merged
lavigne958 merged 1 commit into
masterfrom
test/handle_api_error_not_json
Sep 22, 2024
Merged

lavigne958 merged 1 commit into
masterfrom
test/handle_api_error_not_json

Conversation

@lavigne958

Copy link
Copy Markdown
Collaborator

Manually build an invalid JSON body. Using HTML to fake using the wrong endpoint that returns HTML instead of JSON.

Use that new http client to do some request and make sure the error matches.

@lavigne958
lavigne958 requested a review from alifeee September 22, 2024 21:24
@lavigne958 lavigne958 self-assigned this Sep 22, 2024
Manually build an invalid JSON body. Using HTML to fake using the wrong
endpoint that returns HTML instead of JSON.

Use that new http client to do some request and make sure the error
matches.

Signed-off-by: Alexandre Lavigne <lavigne958@gmail.com>
@alifeee

alifeee commented Sep 22, 2024

Copy link
Copy Markdown
Collaborator

looks splendid ! :)

@lavigne958
lavigne958 merged commit 014f25b into master Sep 22, 2024
@lavigne958
lavigne958 deleted the test/handle_api_error_not_json branch September 22, 2024 22:27
@alifeee alifeee mentioned this pull request Sep 24, 2024
@alifeee alifeee mentioned this pull request Oct 3, 2024
@alifeee

alifeee commented Oct 3, 2024

Copy link
Copy Markdown
Collaborator

hi all

a new release 6.1.3 has been released (on github) (on PyPi) which contains a fix for this issue

we now catch the non-JSON error and turn it into a GSpreadException which should be easier to catch and find out what went wrong with the request

see more context here: #1510

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