Skip to content

Commit

Permalink
Add handling of forbidden errors from here api response
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Burgess committed May 16, 2024
1 parent 8fc6b96 commit d0612f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions herepy/routing_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,8 @@ def error_from_routing_service_error(json_data):
# V8 error handling
if "error" in json_data and json_data["error"] == "Unauthorized":
return InvalidCredentialsError(json_data["error_description"])
elif "error" in json_data and json_data["error"] == "Forbidden":
return InvalidCredentialsError(json_data["error_description"])
elif "status" in json_data:
error_msg = str.format(
"Cause: {0}; Action: {1}", json_data["cause"], json_data["action"]
Expand Down

0 comments on commit d0612f5

Please sign in to comment.