Class (GI Struct)

Gio-2.0GioDBusErrorSince 2.26

Error codes for the G_DBUS_ERROR error domain.

Hierarchy (View Summary)

Index

Constructors

Properties

$gtype: GType<GLib.Error>
ACCESS_DENIED: number

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

ADDRESS_IN_USE: number

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

ADT_AUDIT_DATA_UNKNOWN: number

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

AUTH_FAILED: number

Authentication didn't work.

BAD_ADDRESS: number

A D-Bus bus address was malformed.

DISCONNECTED: number

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

FAILED: number

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

FILE_EXISTS: number

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

FILE_NOT_FOUND: number

Missing file.

INVALID_ARGS: number

Invalid arguments passed to a method call.

INVALID_FILE_CONTENT: number

A file contains invalid syntax or is otherwise broken.

INVALID_SIGNATURE: number

A type signature is not valid.

IO_ERROR: number

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

LIMITS_EXCEEDED: number

Some limited resource is exhausted.

MATCH_RULE_INVALID: number

The match rule isn't syntactically valid.

MATCH_RULE_NOT_FOUND: number

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

NAME_HAS_NO_OWNER: number

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

NO_MEMORY: number

There was not enough memory to complete an operation.

NO_NETWORK: number

No network access (probably ENETUNREACH on a socket).

NO_REPLY: number

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

NO_SERVER: number

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

NOT_SUPPORTED: number

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

OBJECT_PATH_IN_USE: number

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

PROPERTY_READ_ONLY: number

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

SELINUX_SECURITY_CONTEXT_UNKNOWN: number

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

SERVICE_UNKNOWN: number

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

SPAWN_CHILD_EXITED: number

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

SPAWN_CHILD_SIGNALED: number

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

SPAWN_CONFIG_INVALID: number

We failed to setup the config parser correctly.

SPAWN_EXEC_FAILED: number

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

SPAWN_FAILED: number

While starting a new process, something went wrong.

SPAWN_FILE_INVALID: number

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

SPAWN_FORK_FAILED: number

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

SPAWN_NO_MEMORY: number

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

SPAWN_PERMISSIONS_INVALID: number

Permissions are incorrect on the setuid helper.

SPAWN_SERVICE_INVALID: number

Bus name was not valid.

SPAWN_SERVICE_NOT_FOUND: number

Service file not found in system-services directory.

SPAWN_SETUP_FAILED: number

We failed to setup the environment correctly.

TIMED_OUT: number

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

TIMEOUT: number

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

UNIX_PROCESS_ID_UNKNOWN: number

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

UNKNOWN_INTERFACE: number

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

UNKNOWN_METHOD: number

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

UNKNOWN_OBJECT: number

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

UNKNOWN_PROPERTY: number

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

Properties - Inherited from GLib

code: number
domain: number
message: string
stack: string

Methods

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

    If error matches a registered error (see Gio.DBusError.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 GLib.Error using Gio.DBusError.new_for_dbus_error.

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

    Parameters

    Returns string

  • Creates an association mapping between dbus_error_name and GLib.Errors specified by error_domain and error_code.

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

    Parameters

    • error_domain: number

      a GLib.Quark for an error domain

    • error_code: number

      an error code

    • dbus_error_name: string

      a D-Bus error name

    Returns boolean

  • Helper function for associating a GLib.Error error domain with D-Bus error names.

    While quark_volatile has a volatile qualifier, this is a historical artifact and the argument passed to it should not be volatile.

    Parameters

    • error_domain_quark_name: string

      the error domain name

    • quark_volatile: number

      return location for the GLib.Quark representing the error domain

    • entries: DBusErrorEntry[]

      items to register

    Returns void

  • Sets *error to a new GLib.Error created with Gio.DBusError.new_for_dbus_error.

    If format is non-NULL then it is prepended to dbus_error_message. Otherwise dbus_error_message is used unmodified.

    This function does nothing if error is NULL.

    Parameters

    • dbus_error_name: string

      D-Bus error name

    • dbus_error_message: string

      D-Bus error message

    • format: string

      printf()-style format to prepend to dbus_error_message, or NULL to not modify the message

    • ___: any[]

      arguments for format

    Returns GLib.Error

  • Like Gio.DBusError.set_dbus_error but intended for language bindings.

    Parameters

    • dbus_error_name: string

      D-Bus error name

    • dbus_error_message: string

      D-Bus error message

    • format: string

      printf()-style format to prepend to dbus_error_message, or NULL to not modify the message

    • var_args: any

      arguments for format

    Returns GLib.Error

  • 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.

    Parameters

    Returns boolean

  • Destroys an association previously set up with Gio.DBusError.register_error.

    Parameters

    • error_domain: number

      a GLib.Quark for an error domain

    • error_code: number

      an error code

    • dbus_error_name: string

      a D-Bus error name

    Returns boolean

Methods - Inherited from GLib

  • Returns true if error matches domain and code, false otherwise. In particular, when error is null, 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.

    Parameters

    • domain: number | (new (...args: any[]) => GLib.Error)

      an error domain

    • code: number

      an error code

    Returns boolean

    whether error has domain and code

  • This function registers an extended GLib.Error domain. error_type_name will be duplicated. Otherwise does the same as g_error_domain_register_static().

    Parameters

    • error_type_name: string

      string to create a GLib.Quark from

    • error_type_private_size: number

      size of the private error data in bytes

    • error_type_init: ErrorInitFunc

      function initializing fields of the private error data

    • error_type_copy: ErrorCopyFunc

      function copying fields of the private error data

    • error_type_clear: ErrorClearFunc

      function freeing fields of the private error data

    Returns number

  • This function registers an extended GLib.Error domain.

    error_type_name should not be freed. error_type_private_size must be greater than 0.

    error_type_init receives an initialized GLib.Error and should then initialize the private data.

    error_type_copy is a function that receives both original and a copy GLib.Error and should copy the fields of the private error data. The standard GLib.Error fields are already handled.

    error_type_clear receives the pointer to the error, and it should free the fields of the private error data. It should not free the struct itself though.

    Normally, it is better to use G_DEFINE_EXTENDED_ERROR(), as it already takes care of passing valid information to this function.

    Parameters

    • error_type_name: string

      static string to create a GLib.Quark from

    • error_type_private_size: number

      size of the private error data in bytes

    • error_type_init: ErrorInitFunc

      function initializing fields of the private error data

    • error_type_copy: ErrorCopyFunc

      function copying fields of the private error data

    • error_type_clear: ErrorClearFunc

      function freeing fields of the private error data

    Returns number