Exception: Jabber::ErrorException

Inherits:
RuntimeError
  • Object
show all
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

Instance Method Summary collapse

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

#errorObject (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_sObject

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