Skip to content

Commit

Permalink
additional error handling on nist_api
Browse files Browse the repository at this point in the history
  • Loading branch information
P-T-I committed Nov 17, 2023
1 parent 57b44a8 commit a34d182
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CveXplore/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.14
0.3.15
6 changes: 6 additions & 0 deletions CveXplore/api/nvd_nist/nvd_nist_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def _connect(
raise requests.exceptions.ConnectionError(the_response)
else:
the_response = json.loads(r.text)
else:
the_response = r

except JSONDecodeError:
if "content-type" in r.headers:
if r.headers["content-type"] == "text/plain":
Expand All @@ -126,6 +129,9 @@ def _connect(
else:
the_response = r

except Exception:
the_response = r

return the_response

except requests.exceptions.ConnectionError as err:
Expand Down

0 comments on commit a34d182

Please sign in to comment.