Exception: NWRFC::NWError
- Inherits:
-
Exception
- Object
- Exception
- NWRFC::NWError
- Defined in:
- lib/nwrfc/nwerror.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#class ⇒ Object
readonly
Returns the value of attribute class.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(error) ⇒ NWError
constructor
Instantiate Error object with a handle to an FFI::MemoryPointer to an NWRFCLib::RFCError object.
- #inspect ⇒ Object
Constructor Details
#initialize(error) ⇒ NWError
Instantiate Error object with a handle to an FFI::MemoryPointer to an NWRFCLib::RFCError object. The error object is analyzed so that when the caller intercepts it with Rescue, all the error details are available
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/nwrfc/nwerror.rb', line 11 def initialize(error) @code = NWRFCLib::RFC_RC[error[:code]] # In the event that the called function raised an exception, we must create a more specific # error raise(NWABAPException, error[:key].get_str) if @code == :RFC_ABAP_EXCEPTION @group = NWRFCLib::RFC_ERROR_GROUP[error[:group]] @message = error[:message].get_str @type = error[:abapMsgType].get_str @number = error[:abapMsgNumber].get_str end |
Instance Attribute Details
#class ⇒ Object (readonly)
Returns the value of attribute class.
5 6 7 |
# File 'lib/nwrfc/nwerror.rb', line 5 def class @class end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/nwrfc/nwerror.rb', line 5 def code @code end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
5 6 7 |
# File 'lib/nwrfc/nwerror.rb', line 5 def group @group end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/nwrfc/nwerror.rb', line 5 def @message end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
5 6 7 |
# File 'lib/nwrfc/nwerror.rb', line 5 def number @number end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/nwrfc/nwerror.rb', line 5 def type @type end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/nwrfc/nwerror.rb', line 22 def inspect "#{@message} (code #{@code}, group #{@group}, type #{@type}, number #{@number})" end |