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:



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

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

Class Method Details

.import(node) ⇒ Blather::SASLError

Import the stanza

Parameters:

Returns:



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

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

Instance Method Details

#nameSymbol

The actual error name

Returns:

  • (Symbol)

    a symbol representing the error name



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

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