Class: SOAP::Mapping::SOAPException
- Includes:
- SOAP::Marshallable
- Defined in:
- lib/action_web_service/soap/mapping/registry.rb
Overview
Inner class to pass an exception.
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
-
#excn_type_name ⇒ Object
readonly
Returns the value of attribute excn_type_name.
Instance Method Summary collapse
-
#initialize(e) ⇒ SOAPException
constructor
A new instance of SOAPException.
- #to_e ⇒ Object
Constructor Details
#initialize(e) ⇒ SOAPException
Returns a new instance of SOAPException.
38 39 40 41 |
# File 'lib/action_web_service/soap/mapping/registry.rb', line 38 def initialize(e) @excn_type_name = Mapping.name2elename(e.class.to_s) @cause = e end |
Instance Attribute Details
#cause ⇒ Object (readonly)
Returns the value of attribute cause.
37 38 39 |
# File 'lib/action_web_service/soap/mapping/registry.rb', line 37 def cause @cause end |
#excn_type_name ⇒ Object (readonly)
Returns the value of attribute excn_type_name.
37 38 39 |
# File 'lib/action_web_service/soap/mapping/registry.rb', line 37 def excn_type_name @excn_type_name end |
Instance Method Details
#to_e ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/action_web_service/soap/mapping/registry.rb', line 43 def to_e if @cause.is_a?(::Exception) @cause.extend(::SOAP::Mapping::MappedException) return @cause elsif @cause.respond_to?(:message) and @cause.respond_to?(:backtrace) e = RuntimeError.new(@cause.) e.set_backtrace(@cause.backtrace) return e end klass = Mapping.class_from_name(Mapping.elename2name(@excn_type_name.to_s)) if klass.nil? or not klass <= ::Exception return RuntimeError.new(@cause.inspect) end obj = klass.new(@cause.) obj.extend(::SOAP::Mapping::MappedException) obj end |