Skip to content

Commit

Permalink
Removed too broad 408 error code
Browse files Browse the repository at this point in the history
  • Loading branch information
zabuldon committed Jan 15, 2018
1 parent af83868 commit 5fa6300
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions teslajsonpy/Exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ def __init__(self, code, *args, **kwargs):
self.message = 'NOT_FOUND'
elif self.code == 405:
self.message = 'MOBILE_ACCESS_DISABLED'
elif self.code == 408:
self.message = 'VEHICLE_UNAVAILABLE'
elif self.code == 423:
self.message = 'ACCOUNT_LOCKED'
elif self.code == 429:
Expand Down
5 changes: 4 additions & 1 deletion teslajsonpy/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ def __open(self, url, headers={}, data=None, baseurl=""):
opener.close()
return data
except HTTPError as e:
raise TeslaException(e.code)
if e.code == 408:
return False
else:
raise TeslaException(e.code)

0 comments on commit 5fa6300

Please sign in to comment.