Module: SOAP::NestedException
- Included in:
- Error, WSDL::Error, XSD::Error
- Defined in:
- lib/soap/nestedexception.rb
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
-
#original_backtraace ⇒ Object
readonly
Returns the value of attribute original_backtraace.
Instance Method Summary collapse
Instance Attribute Details
#cause ⇒ Object (readonly)
Returns the value of attribute cause.
14 15 16 |
# File 'lib/soap/nestedexception.rb', line 14 def cause @cause end |
#original_backtraace ⇒ Object (readonly)
Returns the value of attribute original_backtraace.
15 16 17 |
# File 'lib/soap/nestedexception.rb', line 15 def original_backtraace @original_backtraace end |
Instance Method Details
#initialize(msg = nil, cause = nil) ⇒ Object
17 18 19 20 21 |
# File 'lib/soap/nestedexception.rb', line 17 def initialize(msg = nil, cause = nil) super(msg) @cause = cause @original_backtrace = nil end |
#set_backtrace(backtrace) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/soap/nestedexception.rb', line 23 def set_backtrace(backtrace) if defined?(@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 |