exception gdbus_util.DBusError

Bases: Exception

An abstract base class for errors that can be returned to D-Bus clients.

Subclasses must define a valid D-Bus error name with the name attribute. See the D-Bus specification for the naming rules.

classmethod is_instance(err) bool

Check if the given error is an instance of this class.

This method is meant for clients which handle a DBusError.

abstract property name: str

A valid D-Bus error name, for example "org.example.Error.FooBar".

classmethod strip_remote_error(err: GError)

Remove the D-Bus error prefix from the message.

This method is meant for clients which handle a DBusError.

It serves the same purpose as Gio.DBusError.strip_remote_error(), but that method is broken in PyGObject, see https://gitlab.gnome.org/GNOME/pygobject/-/issues/342.