Skip to content

Commit

Permalink
Fixed a bug with errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jmkd3v committed Dec 28, 2020
1 parent b3a7403 commit dc95874
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ro_py/utilities/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ def post(self, *args, **kwargs):

if isinstance(post_request_json, dict):
try:
post_request_json["errors"]
post_request_error = post_request_json["errors"]
except KeyError:
return post_request
else:
return post_request

raise ApiError(f"[{str(post_request.status_code)}] {post_request_error[0]['message']}")

def patch(self, *args, **kwargs):
"""
Essentially identical to requests.Session.patch.
Expand Down

0 comments on commit dc95874

Please sign in to comment.