Exception: NWRFC::NWError

Inherits:
Exception
  • Object
show all
Defined in:
lib/nwrfc/nwerror.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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
# File 'lib/nwrfc/nwerror.rb', line 11

def initialize(error)
  @code =    NWRFCLib::RFC_RC[error[:code]]
  @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

#classObject (readonly)

Returns the value of attribute class.



5
6
7
# File 'lib/nwrfc/nwerror.rb', line 5

def class
  @class
end

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/nwrfc/nwerror.rb', line 5

def code
  @code
end

#groupObject (readonly)

Returns the value of attribute group.



5
6
7
# File 'lib/nwrfc/nwerror.rb', line 5

def group
  @group
end

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/nwrfc/nwerror.rb', line 5

def message
  @message
end

#numberObject (readonly)

Returns the value of attribute number.



5
6
7
# File 'lib/nwrfc/nwerror.rb', line 5

def number
  @number
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/nwrfc/nwerror.rb', line 5

def type
  @type
end

Instance Method Details

#inspectObject



19
20
21
# File 'lib/nwrfc/nwerror.rb', line 19

def inspect
  "#{@message} (code #{@code}, group #{@group}, type #{@type}, number #{@number})"
end