Skip to content
Snippets Groups Projects
Commit 9a9a126c authored by Jo Sama's avatar Jo Sama :scream:
Browse files

Use correct JSON decode exception

requests.exceptions.JSONDecodeError is non existent in requests versions
before 3.0.0. Therefore requests is pinned to 2.24 or greater, and we
use ValueError instead of requests.exceptions.JSONDecodeError.
parent 9df79cfd
No related branches found
No related tags found
1 merge request!26Use correct JSON decode exception
Pipeline #100002 passed
......@@ -363,7 +363,7 @@ class SetraClient(object):
return_response=True)
try:
content = response.json()
except requests.exceptions.JSONDecodeError:
except ValueError:
content = response.content
if response.status_code == 202:
......@@ -389,7 +389,7 @@ class SetraClient(object):
try:
content = response.json()
except requests.exceptions.JSONDecodeError:
except ValueError:
content = response.content
if response.status_code == 204:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment