Exception: Jabber::ErrorException
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Jabber::ErrorException
- Defined in:
- lib/xmpp4r/errorexception.rb
Overview
This exception can be raised by Helpers when they receive answers with type='error'
The ErrorException carries a Jabber::Error element
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
The error element which caused this exception.
Instance Method Summary collapse
-
#initialize(error) ⇒ ErrorException
constructor
- Initialize an ErrorException error
-
[Error].
-
#to_s ⇒ Object
Textual output.
Constructor Details
#initialize(error) ⇒ ErrorException
Initialize an ErrorException
- error
- Error
19 20 21 |
# File 'lib/xmpp4r/errorexception.rb', line 19 def initialize(error) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
The error element which caused this exception
14 15 16 |
# File 'lib/xmpp4r/errorexception.rb', line 14 def error @error end |
Instance Method Details
#to_s ⇒ Object
Textual output
Sample:
subscription-required: Please subscribe first
28 29 30 |
# File 'lib/xmpp4r/errorexception.rb', line 28 def to_s "#{@error.error}: #{@error.text}" end |