Module: SOAP::NestedException

Included in:
Error, WSDL::Error, XSD::Error
Defined in:
lib/soap/nestedexception.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) cause (readonly)

Returns the value of attribute cause



13
14
15
# File 'lib/soap/nestedexception.rb', line 13

def cause
  @cause
end

- (Object) original_backtraace (readonly)

Returns the value of attribute original_backtraace



14
15
16
# File 'lib/soap/nestedexception.rb', line 14

def original_backtraace
  @original_backtraace
end

Instance Method Details

- (Object) initialize(msg = nil, cause = nil)



16
17
18
19
20
# File 'lib/soap/nestedexception.rb', line 16

def initialize(msg = nil, cause = nil)
  super(msg)
  @cause = cause
  @original_backtrace = nil
end

- (Object) set_backtrace(backtrace)



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/soap/nestedexception.rb', line 22

def set_backtrace(backtrace)
  if @cause and @cause.respond_to?(:backtrace)
    @original_backtrace = backtrace
=begin
    # for agressive backtrace abstraction: 'here' only should not be good
    here = @original_backtrace[0]
    backtrace = Array[*@cause.backtrace]
    backtrace[0] = "#{backtrace[0]}: #{@cause} (#{@cause.class})"
    backtrace.unshift(here)
=end
    # just join the nested backtrace at the tail of backtrace
    caused = Array[*@cause.backtrace]
    caused[0] = "#{caused[0]}: #{@cause} (#{@cause.class}) [NESTED]"
    backtrace += caused
  end
  super(backtrace)
end