Exception: Longfellow::NativeError

Inherits:
Error
  • Object
show all
Defined in:
lib/longfellow/errors.rb

Overview

Raised when a native call fails. Carries the raw return #code from the C ABI and a stable #symbol for programmatic handling.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol, code, context) ⇒ NativeError

Returns a new instance of NativeError.



12
13
14
15
16
# File 'lib/longfellow/errors.rb', line 12

def initialize(symbol, code, context)
  @symbol = symbol
  @code = code
  super("#{context} failed: #{symbol} (code #{code})")
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



10
11
12
# File 'lib/longfellow/errors.rb', line 10

def code
  @code
end

#symbolObject (readonly)

Returns the value of attribute symbol.



10
11
12
# File 'lib/longfellow/errors.rb', line 10

def symbol
  @symbol
end