Exception: SOAP::FaultError

Inherits:
Error show all
Defined in:
lib/soap/soap.rb

Instance Attribute Summary collapse

Attributes included from NestedException

#cause, #original_backtraace

Instance Method Summary collapse

Methods included from NestedException

#set_backtrace

Constructor Details

#initialize(fault) ⇒ FaultError

Returns a new instance of FaultError.



106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/soap/soap.rb', line 106

def initialize(fault)
  @faultcode = fault.faultcode
  @faultstring = fault.faultstring
  if @faultstring and @faultstring.respond_to?('data')
    @faultmessage = fault.faultstring.data
  else
    @faultmessage = nil
  end
  @faultactor = fault.faultactor
  @detail = fault.detail
  super(self.to_s)
end

Instance Attribute Details

#detailObject

Returns the value of attribute detail.



100
101
102
# File 'lib/soap/soap.rb', line 100

def detail
  @detail
end

#faultactorObject (readonly)

Returns the value of attribute faultactor.



99
100
101
# File 'lib/soap/soap.rb', line 99

def faultactor
  @faultactor
end

#faultcodeObject (readonly)

Returns the value of attribute faultcode.



97
98
99
# File 'lib/soap/soap.rb', line 97

def faultcode
  @faultcode
end

#faultstringObject (readonly)

Returns the value of attribute faultstring.



98
99
100
# File 'lib/soap/soap.rb', line 98

def faultstring
  @faultstring
end

Instance Method Details

#message=(message) ⇒ Object



102
103
104
# File 'lib/soap/soap.rb', line 102

def message=(message)
  @faultmessage = message
end

#to_sObject



119
120
121
122
123
124
125
126
127
# File 'lib/soap/soap.rb', line 119

def to_s
  str = nil
  if @faultmessage
    str = @faultmessage.to_s
  elsif @faultstring and @faultstring.respond_to?('data')
    str = @faultstring.data
  end
  str || '(No faultstring)'
end