Exception: Jabber::ServerError
- Inherits:
-
JabberError
- Object
- StandardError
- JabberError
- Jabber::ServerError
- Defined in:
- 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
35 36 37 |
# File 'lib/xmpp4r/errors.rb', line 35 def initialize(error) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
The error element which caused this exception
30 31 32 |
# File 'lib/xmpp4r/errors.rb', line 30 def error @error end |
Instance Method Details
#to_s ⇒ Object
Sample output: ‘subscription-required: Please subscribe first’
42 43 44 |
# File 'lib/xmpp4r/errors.rb', line 42 def to_s "#{@error.error}: #{@error.text}" end |