Skip to content
Snippets Groups Projects
Commit 6b1884e3 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Don't catch json errors

parent be1a68ef
No related branches found
No related tags found
No related merge requests found
import requests
import json
class Request(object):
......@@ -20,10 +19,7 @@ class Request(object):
**kwargs
)
r.raise_for_status()
try:
return r.json()
except json.JSONDecodeError:
return None
return r.json()
def post(self, endpoint: str, headers=None, **kwargs):
......@@ -33,10 +29,8 @@ class Request(object):
**kwargs
)
r.raise_for_status()
try:
return r.json()
except json.JSONDecodeError:
return None
return r.json()
def put(self, endpoint: str, headers=None, **kwargs):
......@@ -46,10 +40,7 @@ class Request(object):
**kwargs
)
r.raise_for_status()
try:
return r.json()
except json.JSONDecodeError:
return None
return r.json()
def delete(self, endpoint: str, headers=None, **kwargs):
......@@ -59,10 +50,8 @@ class Request(object):
**kwargs
)
r.raise_for_status()
try:
return r.json()
except json.JSONDecodeError:
return None
return r.json()
class AdminRequest(Request):
......
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