Begin working on gateway v4 support.

Bump websockets requirement to v3.1

Should be squashed...
This commit is contained in:
Rapptz
2016-04-26 19:38:54 -04:00
parent fda0c8cea0
commit 1c623ccf11
10 changed files with 451 additions and 153 deletions

View File

@ -101,3 +101,21 @@ class LoginFailure(ClientException):
failure.
"""
pass
class ConnectionClosed(ClientException):
"""Exception that's thrown when the gateway connection is
closed for reasons that could not be handled internally.
Attributes
-----------
code : int
The close code of the websocket.
reason : str
The reason provided for the closure.
"""
def __init__(self, original):
# This exception is just the same exception except
# reconfigured to subclass ClientException for users
self.code = original.code
self.reason = original.reason
super().__init__(str(original))