Sha256: 262ef529e2a8273daf48de4b017a5835500910c0a042ae65f7c0f0574680f9d4

Contents?: true

Size: 844 Bytes

Versions: 34

Compression:

Stored size: 844 Bytes

Contents

module Blather

# General SASL Errors
# Check #name for the error name
#
# @handler :sasl_error
class SASLError < BlatherError
  # @private
  SASL_ERR_NS = 'urn:ietf:params:xml:ns:xmpp-sasl'

  class_attribute :err_name
  # @private
  @@registrations = {}

  register :sasl_error

  # Import the stanza
  #
  # @param [Blather::XMPPNode] node the error node
  # @return [Blather::SASLError]
  def self.import(node)
    self.new node
  end

  # Create a new SASLError
  #
  # @param [Blather::XMPPNode] node the error node
  def initialize(node)
    super()
    @node = node
  end

  # The actual error name
  #
  # @return [Symbol] a symbol representing the error name
  def name
    if @node
      name = @node.find_first('ns:*', :ns => SASL_ERR_NS).element_name
      name.gsub('-', '_').to_sym
    end
  end
end  # SASLError

end  # Blather

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
blather-2.0.0 lib/blather/errors/sasl_error.rb
blather-1.2.0 lib/blather/errors/sasl_error.rb
blather-1.1.4 lib/blather/errors/sasl_error.rb
blather-1.1.3 lib/blather/errors/sasl_error.rb
blather-1.1.2 lib/blather/errors/sasl_error.rb
blather-1.1.1 lib/blather/errors/sasl_error.rb
blather-1.1.0 lib/blather/errors/sasl_error.rb
blather-1.0.0 lib/blather/errors/sasl_error.rb
blather-0.8.8 lib/blather/errors/sasl_error.rb
blather-0.8.7 lib/blather/errors/sasl_error.rb
blather-0.8.6 lib/blather/errors/sasl_error.rb
blather-0.8.5 lib/blather/errors/sasl_error.rb
blather-0.8.4 lib/blather/errors/sasl_error.rb
blather-0.8.3 lib/blather/errors/sasl_error.rb
blather-0.8.2 lib/blather/errors/sasl_error.rb
tp-blather-0.8.5 lib/blather/errors/sasl_error.rb
tp-blather-0.8.4 lib/blather/errors/sasl_error.rb
tp-blather-0.8.3 lib/blather/errors/sasl_error.rb
tp-blather-0.8.2 lib/blather/errors/sasl_error.rb
blather-0.8.1 lib/blather/errors/sasl_error.rb