diff options
Diffstat (limited to 'lib/soap/mapping/mapping.rb')
-rw-r--r-- | lib/soap/mapping/mapping.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/soap/mapping/mapping.rb b/lib/soap/mapping/mapping.rb index 38a01bac0..db7ea607f 100644 --- a/lib/soap/mapping/mapping.rb +++ b/lib/soap/mapping/mapping.rb @@ -68,24 +68,26 @@ module Mapping md_ary end - def self.fault2exception(e, registry = nil) + def self.fault2exception(fault, registry = nil) registry ||= Mapping::DefaultRegistry - detail = if e.detail - soap2obj(e.detail, registry) || "" + detail = if fault.detail + soap2obj(fault.detail, registry) || "" else "" end if detail.is_a?(Mapping::SOAPException) begin - remote_backtrace = detail.to_e.backtrace - raise detail.to_e - rescue Exception => e2 - e2.set_backtrace(remote_backtrace + e2.backtrace) + e = detail.to_e + remote_backtrace = e.backtrace + e.set_backtrace(nil) + raise e # ruby sets current caller as local backtrace of e => e2. + rescue Exception => e + e.set_backtrace(remote_backtrace + e.backtrace[1..-1]) raise end else - e.detail = detail - e.set_backtrace( + fault.detail = detail + fault.set_backtrace( if detail.is_a?(Array) detail else |