:right-sidebar: True Error =================================================================== .. currentmodule:: gi.repository.GLib .. class:: Error(message='unknown error', domain='pygi-error', code=0) :no-contents-entry: The ``Error`` structure contains information about an error that has occurred. Attributes ---------- .. rst-class:: interim-class .. class:: Error :no-index: .. attribute:: domain The error domain, usually a string that you can convert to a GLib quark with :func:`~gi.repository.GLib.quark_from_string`. .. attribute:: code A numeric code that identifies a specific error within the domain. .. attribute:: message A human-readable description of the error. Methods ------- .. rst-class:: interim-class .. class:: Error :no-index: .. method:: matches(domain, code) Returns :const:`True` if ``error`` matches ``domain`` and ``code``\, :const:`False` otherwise. In particular, when ``error`` is :const:`None`, :const:`False` will be returned. If ``domain`` contains a ``FAILED`` (or otherwise generic) error code, you should generally not check for it explicitly, but should instead treat any not-explicitly-recognized error code as being equivalent to the ``FAILED`` code. This way, if the domain is extended in the future to provide a more specific error code for a certain case, your code will still work. :param domain: an error domain :param code: an error code .. classmethod:: new_literal(message, code) :param message: :param code: