Sha256: 1a31c9a909c17e8f14e0e87117acf454f4154af325c2367e8ae284d6aaa45c8d

Contents?: true

Size: 434 Bytes

Versions: 13

Compression:

Stored size: 434 Bytes

Contents

# frozen_string_literal: true

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

13 entries across 13 versions & 1 rubygems

Version Path
gir_ffi-0.15.3 lib/gir_ffi/glib_error.rb
gir_ffi-0.15.2 lib/gir_ffi/glib_error.rb
gir_ffi-0.15.1 lib/gir_ffi/glib_error.rb
gir_ffi-0.15.0 lib/gir_ffi/glib_error.rb
gir_ffi-0.14.1 lib/gir_ffi/glib_error.rb
gir_ffi-0.14.0 lib/gir_ffi/glib_error.rb
gir_ffi-0.13.1 lib/gir_ffi/glib_error.rb
gir_ffi-0.13.0 lib/gir_ffi/glib_error.rb
gir_ffi-0.12.1 lib/gir_ffi/glib_error.rb
gir_ffi-0.12.0 lib/gir_ffi/glib_error.rb
gir_ffi-0.11.4 lib/gir_ffi/glib_error.rb
gir_ffi-0.11.3 lib/gir_ffi/glib_error.rb
gir_ffi-0.11.2 lib/gir_ffi/glib_error.rb