Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch JsonDecodeException and raise exception with response content #456

Merged
merged 6 commits into from
Aug 30, 2023

Conversation

dirkkul
Copy link
Collaborator

@dirkkul dirkkul commented Aug 30, 2023

Catches JsonDecode errors, raises a custom exception ResponseCannotBeDecodedException that contains the response.

Stack trace will look like this

            except JSONDecodeError:
>               raise ResponseCannotBeDecodedException(location, response)
E               weaviate.exceptions.ResponseCannotBeDecodedException: Cannot decode response from weaviate <Response [200]> with content b'JsonCannotParseThis' for request from Get shards' status

where JsonCannotParseThis was the response that is not valid Json

weaviate/exceptions.py Outdated Show resolved Hide resolved
weaviate/util.py Show resolved Hide resolved
weaviate/util.py Outdated Show resolved Hide resolved
@dirkkul dirkkul merged commit 4b2aa43 into main Aug 30, 2023
@dirkkul dirkkul deleted the json_decode_error branch August 30, 2023 10:12
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.

3 participants