Sha256: ed1d62ccc992ceab82a913eb9367dddb93f28a37ba6becd129de762a04d43adc

Contents?: true

Size: 419 Bytes

Versions: 9

Compression:

Stored size: 419 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, :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

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.17.0 lib/gir_ffi/glib_error.rb
gir_ffi-0.16.1 lib/gir_ffi/glib_error.rb
gir_ffi-0.16.0 lib/gir_ffi/glib_error.rb
gir_ffi-0.15.9 lib/gir_ffi/glib_error.rb
gir_ffi-0.15.8 lib/gir_ffi/glib_error.rb
gir_ffi-0.15.7 lib/gir_ffi/glib_error.rb
gir_ffi-0.15.6 lib/gir_ffi/glib_error.rb
gir_ffi-0.15.5 lib/gir_ffi/glib_error.rb
gir_ffi-0.15.4 lib/gir_ffi/glib_error.rb