Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit 1e7999b

Browse files
committed
Merge pull request #16 from PCManticore/fix15
Verify the response status from the API
2 parents 0553956 + caeeac2 commit 1e7999b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/codacy/reporter.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,11 @@ def upload_report(report, token, commit):
108108
logging.debug(r.content)
109109
r.raise_for_status()
110110

111-
message = json.loads(r.text)['success']
112-
logging.info(message)
111+
response = json.loads(r.text)
112+
try:
113+
logging.info(response['success'])
114+
except KeyError:
115+
logging.error(response['error'])
113116

114117

115118
def run():

0 commit comments

Comments
 (0)