Exception: GirFFI::GLibError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/gir_ffi/glib_error.rb

Overview

Exception class to be raised whenever an error is signaled through GLib::Error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(g_error) ⇒ GLibError

Returns a new instance of GLibError.



9
10
11
12
13
# File 'lib/gir_ffi/glib_error.rb', line 9

def initialize(g_error)
  @domain_quark = g_error.domain
  @code = g_error.code
  super g_error.message
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



7
8
9
# File 'lib/gir_ffi/glib_error.rb', line 7

def code
  @code
end

#domain_quarkObject (readonly)

Returns the value of attribute domain_quark.



6
7
8
# File 'lib/gir_ffi/glib_error.rb', line 6

def domain_quark
  @domain_quark
end

Instance Method Details

#domainObject



15
16
17
# File 'lib/gir_ffi/glib_error.rb', line 15

def domain
  @domain ||= GLib.quark_to_string @domain_quark
end