File: error.rb

package info (click to toggle)
ruby-gir-ffi 0.16.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 924 kB
  • sloc: ruby: 6,849; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 376 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

GLib.load_class :Error

module GLib
  # Overrides for GError, used by GLib for handling non-fatal errors.
  class Error
    GIR_FFI_DOMAIN = GLib.quark_from_string("gir_ffi")

    def self.from_exception(exception)
      new_literal GIR_FFI_DOMAIN, 0, exception.message
    end

    def self.from(obj)
      from_exception obj
    end
  end
end