Exception: Blather::SASLError

Inherits:
BlatherError show all
Defined in:
lib/blather/errors/sasl_error.rb

Overview

General SASL Errors Check #name for the error name

Constant Summary collapse

SASL_ERR_NS =
'urn:ietf:params:xml:ns:xmpp-sasl'
@@registrations =
{}

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BlatherError

handler_list, #id, register

Constructor Details

#initialize(node) ⇒ SASLError

Create a new SASLError

Parameters:



27
28
29
30
# File 'lib/blather/errors/sasl_error.rb', line 27

def initialize(node)
  super()
  @node = node
end

Class Method Details

.import(node) ⇒ Blather::SASLError

Import the stanza

Parameters:

Returns:



20
21
22
# File 'lib/blather/errors/sasl_error.rb', line 20

def self.import(node)
  self.new node
end

Instance Method Details

#nameSymbol

The actual error name

Returns:

  • (Symbol)

    a symbol representing the error name



35
36
37
38
39
40
# File 'lib/blather/errors/sasl_error.rb', line 35

def name
  if @node
    name = @node.find_first('ns:*', :ns => SASL_ERR_NS).element_name
    name.gsub('-', '_').to_sym
  end
end