4.4 <GDBusError>

Enumeration: <GDBusError>

Error codes for the G_DBUS_ERROR error domain.

Members

failed

A generic error; "something went wrong" - see the error message for more.

no-memory

There was not enough memory to complete an operation.

service-unknown

The bus doesn’t know how to launch a service to supply the bus name you wanted.

name-has-no-owner

The bus name you referenced doesn’t exist (i.e. no application owns it).

no-reply

No reply to a message expecting one, usually means a timeout occurred.

io-error

Something went wrong reading or writing to a socket, for example.

bad-address

A D-Bus bus address was malformed.

not-supported

Requested operation isn’t supported (like ENOSYS on UNIX).

limits-exceeded

Some limited resource is exhausted.

access-denied

Security restrictions don’t allow doing what you’re trying to do.

auth-failed

Authentication didn’t work.

no-server

Unable to connect to server (probably caused by ECONNREFUSED on a socket).

timeout

Certain timeout errors, possibly ETIMEDOUT on a socket. Note that no-reply is used for message reply timeouts. Warning: this is confusingly-named given that timed-out also exists. We can’t fix it for compatibility reasons so just be careful.

no-network

No network access (probably ENETUNREACH on a socket).

address-in-use

Can’t bind a socket since its address is in use (i.e. EADDRINUSE).

disconnected

The connection is disconnected and you’re trying to use it.

invalid-args

Invalid arguments passed to a method call.

file-not-found

Missing file.

file-exists

Existing file and the operation you’re using does not silently overwrite.

unknown-method

Method name you invoked isn’t known by the object you invoked it on.

timed-out

Certain timeout errors, e.g. while starting a service. Warning: this is confusingly-named given that timeout also exists. We can’t fix it for compatibility reasons so just be careful.

match-rule-not-found

Tried to remove or modify a match rule that didn’t exist.

match-rule-invalid

The match rule isn’t syntactically valid.

spawn-exec-failed

While starting a new process, the exec() call failed.

spawn-fork-failed

While starting a new process, the fork() call failed.

spawn-child-exited

While starting a new process, the child exited with a status code.

spawn-child-signaled

While starting a new process, the child exited on a signal.

spawn-failed

While starting a new process, something went wrong.

spawn-setup-failed

We failed to setup the environment correctly.

spawn-config-invalid

We failed to setup the config parser correctly.

spawn-service-invalid

Bus name was not valid.

spawn-service-not-found

Service file not found in system-services directory.

spawn-permissions-invalid

Permissions are incorrect on the setuid helper.

spawn-file-invalid

Service file invalid (Name, User or Exec missing).

spawn-no-memory

Tried to get a UNIX process ID and it wasn’t available.

unix-process-id-unknown

Tried to get a UNIX process ID and it wasn’t available.

invalid-signature

A type signature is not valid.

invalid-file-content

A file contains invalid syntax or is otherwise broken.

selinux-security-context-unknown

Asked for SELinux security context and it wasn’t available.

adt-audit-data-unknown

Asked for ADT audit data and it wasn’t available.

object-path-in-use

There’s already an object with the requested object path.

unknown-object

Object you invoked a method on isn’t known. Since 2.42

unknown-interface

Interface you invoked a method on isn’t known by the object. Since 2.42

unknown-property

Property you tried to access isn’t known by the object. Since 2.42

property-read-only

Property you tried to set is read-only. Since 2.42

Procedures

Procedure: dbus-error:encode-gerror error ⇒ %return

Creates a D-Bus error name to use for error.

If error matches a registered error (see dbus-error:register-error?), the corresponding D-Bus error name will be returned.

Otherwise the a name of the form org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE will be used. This allows other GDBus applications to map the error on the wire back to a <GError> using dbus-error:new-for-dbus-error.

This function is typically only used in object mappings to put a <GError> on the wire. Regular applications should not use it.

error

Passed: a <GError>.

an error

%return

Returned: a string.

a D-Bus error name

Procedure: dbus-error:get-remote-error error ⇒ %return

Gets the D-Bus error name used for error, if any.

This function is guaranteed to return a D-Bus error name for all <GError>s returned from functions handling remote method calls (for example, dbus-connection:call-finish) unless dbus-error:strip-remote-error? has already been used on error.

error

Passed: a <GError>.

an error

%return

Returned: a string, or #f.

an allocated string, or NULL if the D-Bus error name could not be found

Procedure: dbus-error:is-remote-error? error ⇒ %return

Checks if error represents an error received via D-Bus from a remote peer.

If so, use dbus-error:get-remote-error to get the name of the error.

error

Passed: a <GError>.

an error

%return

Returned: a boolean.

true if error represents an error from a remote peer; false otherwise

Procedure: dbus-error:new-for-dbus-error dbus-error-name dbus-error-message ⇒ %return

Creates a <GError> based on the contents of dbus-error-name and dbus-error-message.

Errors registered with dbus-error:register-error? will be looked up using dbus-error-name and if a match is found, the error domain and code is used. Applications can use dbus-error:get-remote-error to recover dbus-error-name.

If a match against a registered error is not found and the D-Bus error name is in a form as returned by dbus-error:encode-gerror the error domain and code encoded in the name is used to create the <GError>. Also, dbus-error-name is added to the error message such that it can be recovered with dbus-error:get-remote-error.

Otherwise, a <GError> with the error code Gio.IOErrorEnum.DBUS_ERROR in the <GIOErrorEnum> error domain is returned. Also, dbus-error-name is added to the error message such that it can be recovered with dbus-error:get-remote-error.

In all three cases, dbus-error-name can always be recovered from the returned <GError> using the dbus-error:get-remote-error function (unless dbus-error:strip-remote-error? hasn’t been used on the returned error).

This function is typically only used in object mappings to prepare <GError> instances for applications. Regular applications should not use it.

dbus-error-name

Passed: a string.

D-Bus error name

dbus-error-message

Passed: a string.

D-Bus error message

%return

Returned: a <GError>.

an allocated <GError>

Procedure: dbus-error:quark ⇒ %return
%return

Returned: an unsigned 32-bit integer.

Procedure: dbus-error:register-error? error-domain error-code dbus-error-name ⇒ %return

Creates an association mapping between dbus-error-name and <GError>s specified by error-domain and error-code.

This is typically done in the function that returns the GLib.Quark for an error domain.

error-domain

Passed: an unsigned 32-bit integer.

a GLib.Quark for an error domain

error-code

Passed: a 32-bit integer.

an error code

dbus-error-name

Passed: a string.

a D-Bus error name

%return

Returned: a boolean.

true if the association was created, false if it already exists

Procedure: dbus-error:strip-remote-error? error ⇒ %return

Looks for extra information in the error message used to recover the D-Bus error name and strips it if found.

If stripped, the message field in error will correspond exactly to what was received on the wire.

This is typically used when presenting errors to the end user.

error

Passed: a <GError>.

an error

%return

Returned: a boolean.

true if information was stripped; false otherwise

Procedure: dbus-error:unregister-error? error-domain error-code dbus-error-name ⇒ %return

Destroys an association previously set up with dbus-error:register-error?.

error-domain

Passed: an unsigned 32-bit integer.

a GLib.Quark for an error domain

error-code

Passed: a 32-bit integer.

an error code

dbus-error-name

Passed: a string.

a D-Bus error name

%return

Returned: a boolean.

true if the association was destroyed, false if it wasn’t found