1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """PyXMPP exceptions.
19
20 This module defines all exceptions raised by PyXMPP.
21 """
22
23 __docformat__="restructuredtext en"
24
25 import logging
26
27
28 -class Error(StandardError):
29 """Base class for all PyXMPP exceptions."""
30 pass
31
33 "Exception raised when invalid JID is used"
34 pass
35
37 """Base class for all stream errors."""
38 pass
39
41 """Exception raised when stream encryption is requested, but not used."""
42 pass
43
45 """Exception raised when the connected host name is other then requested."""
46 pass
47
49 """Base class for all fatal Stream exceptions.
50
51 When `FatalStreamError` is raised the stream is no longer usable."""
52 pass
53
55 """Raised when invalid XML is received in an XMPP stream."""
56 pass
57
59 """Raised when no host name could be resolved for the target."""
60 pass
61
63 """Raised when CNAME record was found when A or AAAA was expected."""
64 pass
65
67 """Raised when stream authentication fails."""
68 pass
69
71 """Raised when stream TLS negotiation fails."""
72 pass
73
75 """Raised on TLS error during stream processing."""
76 pass
77
79 """Raised on TLS error during stream processing."""
80 pass
81
83 """Raised when SASL authentication is requested, but not available."""
84 pass
85
87 """Raised when none of SASL authentication mechanisms requested is
88 available."""
89 pass
90
92 """Raised when stream SASL authentication fails."""
93 pass
94
96 """Exception raised when string preparation results in error."""
97 pass
98
100 """Raised on a client error."""
101 pass
102
104 """Raised on a fatal client error."""
105 pass
106
108 """Raised on a client stream error."""
109 pass
110
112 """Raised on a fatal client stream error."""
113 pass
114
116 """Raised on a legacy authentication error."""
117 pass
118
120 """Raised on a in-band registration error."""
121 pass
122
124 """Raised on a component error."""
125 pass
126
128 """Raised on a fatal component error."""
129 pass
130
135 """Raised when there is something wrong with a stanza processed.
136
137 When not processed earlier by an application, the exception will be catched
138 by the stanza dispatcher to return XMPP error to the stanza sender, when
139 allowed.
140
141 ProtocolErrors handled internally by PyXMPP will be logged via the logging
142 interface. Errors reported to the sender will be logged using
143 "pyxmpp.ProtocolError.reported" channel and the ignored errors using
144 "pyxmpp.ProtocolError.ignored" channel. Both with the "debug" level.
145
146 :Ivariables:
147 - `xmpp_name` -- XMPP error name which should be reported.
148 - `message` -- the error message."""
149
150 logger_reported = logging.getLogger("pyxmpp.ProtocolError.reported")
151 logger_ignored = logging.getLogger("pyxmpp.ProtocolError.ignored")
152
153 - def __init__(self, xmpp_name, message):
155 @property
158 @property
166 return str(self.args[1])
169
171 """Raised when invalid stanza is processed and 'bad-request' error should be reported."""
174
179
181 """Raised when stanza requests a feature which is not (yet) implemented."""
184
185
186