-
Notifications
You must be signed in to change notification settings - Fork 81
/
errors.py
51 lines (43 loc) · 1.48 KB
/
errors.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- coding: utf-8 -*-
class CodecNotSupportedError(Exception):
"""Throwned when receiving an audio packet from an unsupported codec"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class ConnectionRejectedError(Exception):
"""Throwned when server reject the connection"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidFormatError(Exception):
"""Throwned when receiving a packet not understood"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class UnknownCallbackError(Exception):
"""Throwned when asked for an unknown callback"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class UnknownChannelError(Exception):
"""Throwned when using an unknown channel"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidSoundDataError(Exception):
"""Throwned when trying to send an invalid audio pcm data"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidVarInt(Exception):
"""Throwned when trying to decode an invalid varint"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)