Exception: Libis::Services::SoapError

Inherits:
Exception
  • Object
show all
Defined in:
lib/libis/services/soap_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ SoapError

Returns a new instance of SoapError.



9
10
11
12
13
14
# File 'lib/libis/services/soap_error.rb', line 9

def initialize(error)
  @code = error[:fault][:faultcode] rescue nil
  @text = error[:fault][:faultstring] rescue nil
  @detail = error[:fault][:detail] rescue nil
  @name = @detail.first.first rescue nil
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



7
8
9
# File 'lib/libis/services/soap_error.rb', line 7

def code
  @code
end

#detailObject

Returns the value of attribute detail.



7
8
9
# File 'lib/libis/services/soap_error.rb', line 7

def detail
  @detail
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/libis/services/soap_error.rb', line 7

def name
  @name
end

#textObject

Returns the value of attribute text.



7
8
9
# File 'lib/libis/services/soap_error.rb', line 7

def text
  @text
end

Instance Method Details

#messageObject



16
17
18
# File 'lib/libis/services/soap_error.rb', line 16

def message
  "#{code}:#{name} #{text}"
end