Sha256: a7c9dc924b5b67fde6c721131115f043302350dc42df840743527ada47db7b35

Contents?: true

Size: 403 Bytes

Versions: 10

Compression:

Stored size: 403 Bytes

Contents

module GirFFI
  # Exception class to be raised whenever an error is signaled through
  # GLib::Error.
  class GLibError < RuntimeError
    attr_reader :domain_quark
    attr_reader :code

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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 lib/gir_ffi/glib_error.rb
gir_ffi-0.9.1 lib/gir_ffi/glib_error.rb
gir_ffi-0.9.0 lib/gir_ffi/glib_error.rb
gir_ffi-0.8.6 lib/gir_ffi/glib_error.rb
gir_ffi-0.8.5 lib/gir_ffi/glib_error.rb
gir_ffi-0.8.4 lib/gir_ffi/glib_error.rb
gir_ffi-0.8.3 lib/gir_ffi/glib_error.rb
gir_ffi-0.8.2 lib/gir_ffi/glib_error.rb
gir_ffi-0.8.1 lib/gir_ffi/glib_error.rb
gir_ffi-0.8.0 lib/gir_ffi/glib_error.rb