Skip to content

Commit

Permalink
Throw better error if errorCode isn't included in response
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkGodwin committed Nov 5, 2023
1 parent f9812ca commit 6f8fcb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "tplink_omada_client"
version = "1.3.5"
version = "1.3.6"
authors = [
{ name="Mark Godwin", email="author@example.com" },
]
Expand Down
2 changes: 2 additions & 0 deletions src/tplink_omada_client/omadaapiconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ async def _do_request(
def _check_application_errors(self, response):
if not isinstance(response, dict):
return
if not "errorCode" in response:
raise RequestFailed(-30109, "Unexpected response: " + str(response))
if response["errorCode"] == 0:
return
if response["errorCode"] == -30109:
Expand Down

0 comments on commit 6f8fcb0

Please sign in to comment.