Skip to content

Commit

Permalink
add 410/MsgTooLongError
Browse files Browse the repository at this point in the history
  • Loading branch information
guanlisheng committed Apr 1, 2024
1 parent b305bba commit a2f638c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions synochat/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def __init__(self, message="Rate limit exceeded. Creating posts too fast."):
self.message = message
super().__init__(self.message)

class MsgTooLongError(Error):
""" Raised when msg too long. """
def __init__(self, message="msg too long."):
self.message = message
super().__init__(self.message)

class UnknownApiError(Error):
"""
Expand Down
2 changes: 2 additions & 0 deletions synochat/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def checkResponse(self, response):
raise InvalidPayloadError()
elif error_code == 404:
raise InvalidTokenError()
elif error_code == 410:
raise MsgTooLongError()
elif error_code == 411:
raise RateLimitError()
else:
Expand Down

0 comments on commit a2f638c

Please sign in to comment.