Skip to content

Commit

Permalink
Merge pull request #234 from austinmroczek/fix-231
Browse files Browse the repository at this point in the history
handle ResultCode -123
  • Loading branch information
austinmroczek authored Dec 23, 2024
2 parents 0962703 + 68af566 commit 3cf2eb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions total_connect_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ def raise_for_resultcode(self, response):
):
return
self._raise_for_retry(response)
if rc == _ResultCode.BAD_USER_OR_PASSWORD:
raise AuthenticationError(rc.name, response)
if rc == _ResultCode.AUTHENTICATION_FAILED:
if rc in (_ResultCode.BAD_USER_OR_PASSWORD, _ResultCode.AUTHENTICATION_FAILED, _ResultCode.ACCOUNT_LOCKED):
raise AuthenticationError(rc.name, response)
if rc == _ResultCode.USER_CODE_UNAVAILABLE:
raise UsercodeUnavailable(rc.name, response)
Expand Down
1 change: 1 addition & 0 deletions total_connect_client/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def from_response(response_dict):
INVALID_SESSION = -102
AUTHENTICATION_FAILED = -100
CONNECTION_ERROR = 4101
ACCOUNT_LOCKED = -123


PROJECT_URL = "https://github.com/craigjmidwinter/total-connect-client"
Expand Down

0 comments on commit 3cf2eb6

Please sign in to comment.