Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/twitchio/errors.py
7774 views
1
"""
2
The MIT License (MIT)
3
4
Copyright (c) 2017-2021 TwitchIO
5
6
Permission is hereby granted, free of charge, to any person obtaining a
7
copy of this software and associated documentation files (the "Software"),
8
to deal in the Software without restriction, including without limitation
9
the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
and/or sell copies of the Software, and to permit persons to whom the
11
Software is furnished to do so, subject to the following conditions:
12
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
15
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
DEALINGS IN THE SOFTWARE.
23
"""
24
from typing import Any, Optional
25
26
27
__all__ = (
28
"TwitchIOException",
29
"AuthenticationError",
30
"InvalidContent",
31
"IRCCooldownError",
32
"EchoMessageWarning",
33
"NoClientID",
34
"NoToken",
35
"HTTPException",
36
"Unauthorized",
37
)
38
39
40
class TwitchIOException(Exception):
41
pass
42
43
44
class AuthenticationError(TwitchIOException):
45
pass
46
47
48
class InvalidContent(TwitchIOException):
49
pass
50
51
52
class IRCCooldownError(TwitchIOException):
53
pass
54
55
56
class EchoMessageWarning(TwitchIOException):
57
pass
58
59
60
class NoClientID(TwitchIOException):
61
pass
62
63
64
class NoToken(TwitchIOException):
65
pass
66
67
68
class HTTPException(TwitchIOException):
69
def __init__(
70
self, message: str, *, reason: Optional[str] = None, status: Optional[int] = None, extra: Optional[Any] = None
71
):
72
73
self.message = message
74
self.reason = reason
75
self.status = status
76
self.extra = extra
77
78
79
class Unauthorized(HTTPException):
80
pass
81
82