Skip to content

Commit

Permalink
Add ExecutionQueueFullException (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl authored Nov 20, 2023
1 parent 4b99f41 commit f8852be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ disable=
redefined-builtin

max-module-lines=2000
max-statements=60
5 changes: 5 additions & 0 deletions pyoverkiz/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
BadCredentialsException,
CozyTouchBadCredentialsException,
CozyTouchServiceException,
ExecutionQueueFullException,
InvalidCommandException,
InvalidEventListenerIdException,
InvalidTokenException,
Expand Down Expand Up @@ -1002,6 +1003,10 @@ async def check_response(response: ClientResponse) -> None:
if message == "too many concurrent requests":
raise TooManyConcurrentRequestsException(message)

# {'errorCode': 'EXEC_QUEUE_FULL', 'error': 'Execution queue is full on gateway: #xxx-yyyy-zzzz (soft limit: 10)'}
if "Execution queue is full on gateway" in message:
raise ExecutionQueueFullException(message)

if message == "Cannot use JSESSIONID and bearer token in same request":
raise SessionAndBearerInSameRequestException(message)

Expand Down
4 changes: 4 additions & 0 deletions pyoverkiz/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class TooManyExecutionsException(BaseOverkizException):
pass


class ExecutionQueueFullException(BaseOverkizException):
pass


class TooManyRequestsException(BaseOverkizException):
pass

Expand Down

0 comments on commit f8852be

Please sign in to comment.