Exception: Ccharts::Error

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

Overview

Raised when the C layer reports a non-OK status, carrying the library's human-readable message.

Class Method Summary collapse

Class Method Details

.for_status(status) ⇒ Object



25
26
27
28
# File 'lib/ccharts.rb', line 25

def self.for_status(status)
  msg = FFI.read_cstr(FFI::ERROR_MSG.call(status)) || "unknown ccharts error"
  new("#{msg} (status #{status})")
end