summaryrefslogtreecommitdiff
path: root/game/python-extra/ws4py/exc.py
blob: bfefea4b60c3547bd231b3562856006888991b64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-

__all__ = ['WebSocketException', 'FrameTooLargeException', 'ProtocolException',
           'UnsupportedFrameTypeException', 'TextFrameEncodingException',
           'UnsupportedFrameTypeException', 'TextFrameEncodingException',
           'StreamClosed', 'HandshakeError', 'InvalidBytesError']

class WebSocketException(Exception): pass

class ProtocolException(WebSocketException): pass

class FrameTooLargeException(WebSocketException): pass

class UnsupportedFrameTypeException(WebSocketException): pass

class TextFrameEncodingException(WebSocketException): pass

class InvalidBytesError(WebSocketException): pass

class StreamClosed(Exception): pass

class HandshakeError(WebSocketException):
    def __init__(self, msg):
        self.msg = msg

    def __str__(self):
        return self.msg