Exception: Jabber::ServerError
- Inherits:
-
JabberError
- Object
- StandardError
- JabberError
- Jabber::ServerError
- Defined in:
- lib/vendor/xmpp4r/lib/xmpp4r/errors.rb
Overview
An error returned from the server
e.g. This exception can be raised by helpers when they receive a server reply with type='error'
The ServerError carries a Jabber::ErrorResponse element
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
The error element which caused this exception.
Instance Method Summary collapse
-
#initialize(error) ⇒ ServerError
constructor
- Initialize a ServerError by passing an ErrorResponse instance error
-
[Error].
-
#to_s ⇒ Object
Sample output: ‘subscription-required: Please subscribe first’.
Constructor Details
#initialize(error) ⇒ ServerError
Initialize a ServerError by passing an ErrorResponse instance
- error
- Error
32 33 34 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/errors.rb', line 32 def initialize(error) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
The error element which caused this exception
27 28 29 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/errors.rb', line 27 def error @error end |
Instance Method Details
#to_s ⇒ Object
Sample output: ‘subscription-required: Please subscribe first’
39 40 41 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/errors.rb', line 39 def to_s "#{@error.error}: #{@error.text}" end |