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  __revision__="$Id: error.py 647 2006-08-26 18:27:39Z jajcus $" 
 24  __docformat__="restructuredtext en" 
 25   
 26  import logging 
 27   
 28   
 29 -class Error(StandardError): 
  30      """Base class for all PyXMPP exceptions.""" 
 31      pass 
  32   
 34      "Exception raised when invalid JID is used" 
 35      pass 
  36   
 38      """Base class for all stream errors.""" 
 39      pass 
  40   
 42      """Exception raised when stream encryption is requested, but not used.""" 
 43      pass 
  44   
 46      """Exception raised when the connected host name is other then requested.""" 
 47      pass 
  48   
 50      """Base class for all fatal Stream exceptions. 
 51   
 52      When `FatalStreamError` is raised the stream is no longer usable.""" 
 53      pass 
  54   
 56      """Raised when invalid XML is received in an XMPP stream.""" 
 57      pass 
  58   
 60      """Raised when stream authentication fails.""" 
 61      pass 
  62   
 64      """Raised when stream TLS negotiation fails.""" 
 65      pass 
  66   
 68      """Raised on TLS error during stream processing.""" 
 69      pass 
  70   
 72      """Raised on TLS error during stream processing.""" 
 73      pass 
  74   
 76      """Raised when SASL authentication is requested, but not available.""" 
 77      pass 
  78   
 80      """Raised when none of SASL authentication mechanisms requested is 
 81      available.""" 
 82      pass 
  83   
 85      """Raised when stream SASL authentication fails.""" 
 86      pass 
  87   
 89      """Exception raised when string preparation results in error.""" 
 90      pass 
  91   
 93      """Raised on a client error.""" 
 94      pass 
  95   
 97      """Raised on a fatal client error.""" 
 98      pass 
  99   
101      """Raised on a client stream error.""" 
102      pass 
 103   
105      """Raised on a fatal client stream error.""" 
106      pass 
 107   
109      """Raised on a legacy authentication error.""" 
110      pass 
 111   
113      """Raised on a in-band registration error.""" 
114      pass 
 115   
117      """Raised on a component error.""" 
118      pass 
 119   
121      """Raised on a fatal component error.""" 
122      pass 
 123   
128      """Raised when there is something wrong with a stanza processed. 
129   
130      When not processed earlier by an application, the exception will be catched 
131      by the stanza dispatcher to return XMPP error to the stanza sender, when 
132      allowed. 
133   
134      ProtocolErrors handled internally by PyXMPP will be logged via the logging 
135      interface. Errors reported to the sender will be logged using 
136      "pyxmpp.ProtocolError.reported" channel and the ignored errors using 
137      "pyxmpp.ProtocolError.ignored" channel. Both with the "debug" level. 
138       
139      :Ivariables: 
140          - `xmpp_name` -- XMPP error name which should be reported. 
141          - `message` -- the error message.""" 
142   
143      logger_reported = logging.getLogger("pyxmpp.ProtocolError.reported") 
144      logger_ignored = logging.getLogger("pyxmpp.ProtocolError.ignored") 
145   
146 -    def __init__(self, xmpp_name, message): 
 148      @property 
151      @property 
159          return str(self.args[1]) 
  162   
164      """Raised when invalid stanza is processed and 'bad-request' error should be reported.""" 
 167   
172   
174      """Raised when stanza requests a feature which is not (yet) implemented.""" 
 177   
178   
179