Skip to content

Commit

Permalink
Fix detection of error messages. (#843)
Browse files Browse the repository at this point in the history
* Fix detection of error messages.

Don't try to do exact matches, but use "in".
One issue being that the message usually looks like:
  '"No registered event listener."'
(Note the extra quotes.)

* client.py: Remove outer quotes from error messages
  • Loading branch information
shypike committed May 20, 2023
1 parent e34e2e8 commit a8bbb43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyoverkiz/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ async def check_response(response: ClientResponse) -> None:
) from error

if result.get("errorCode"):
message = result.get("error")
message = result.get("error").strip("'")

# {"errorCode": "AUTHENTICATION_ERROR",
# "error": "Too many requests, try again later : login with xxx@xxx.tld"}
Expand Down

0 comments on commit a8bbb43

Please sign in to comment.