Exception: Rnp::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rnp/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, rc = nil) ⇒ Error

Returns a new instance of Error.


11
12
13
14
15
16
17
18
# File 'lib/rnp/error.rb', line 11

def initialize(msg, rc = nil)
  @rc = rc
  if rc
    desc = LibRnp.rnp_result_to_string(rc)
    msg = "#{msg} - (rc: 0x#{rc.to_s(16)}): #{desc}"
  end
  super(msg)
end

Instance Attribute Details

#rcObject (readonly)

Returns the value of attribute rc


9
10
11
# File 'lib/rnp/error.rb', line 9

def rc
  @rc
end