class NWRFC::NWError

Attributes

class[R]
code[R]
group[R]
message[R]
number[R]
type[R]

Public Class Methods

new(error) click to toggle source

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

# 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

Public Instance Methods

inspect() click to toggle source
# File lib/nwrfc/nwerror.rb, line 22
def inspect
  "#{@message} (code #{@code}, group #{@group}, type #{@type}, number #{@number})"
end