Skip to content

Commit 05efe80

Browse files
committed
fix errors reporting
1 parent 475e1ae commit 05efe80

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

api_github/github.py

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ def _parse_headers(self, headers):
109109
isValid = _parse_headers(self, e.headers)
110110
if isValid:
111111
json_data = json.loads(e.read())
112+
else:
113+
json_data = None
112114
req = dict(method=method, url=url)
113115
resp = dict(code=e.code, json=json_data)
114116
if resp['code'] == 404:

api_gitlab/gitlab.py

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def _parse_headers(self, headers):
7878
isValid = self._parse_headers(e.headers)
7979
if isValid:
8080
json_data = json.loads(e.read())
81+
else:
82+
json_data = None
8183
req = dict(method=method, url=url)
8284
resp = dict(code=e.code, json=json_data)
8385
if resp['code'] == 404:

utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def _parse_headers(self, headers):
168168
isValid = _parse_headers(self, e.headers)
169169
if isValid:
170170
json_data = json.loads(e.read())
171+
else:
172+
json_data = None
171173
req = dict(method=method, url=url)
172174
resp = dict(code=e.code, json=json_data)
173175
if resp['code'] == 404:

0 commit comments

Comments
 (0)