Enum Class DBusError

java.lang.Object
java.lang.Enum<DBusError>
org.gnome.gio.DBusError
All Implemented Interfaces:
Serializable, Comparable<DBusError>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum DBusError extends Enum<DBusError> implements Enumeration
Error codes for the G_DBUS_ERROR error domain.
Since:
2.26
  • Enum Constant Details

    • FAILED

      public static final DBusError FAILED
      A generic error; "something went wrong" - see the error message for more.
    • NO_MEMORY

      public static final DBusError NO_MEMORY
      There was not enough memory to complete an operation.
    • SERVICE_UNKNOWN

      public static final DBusError SERVICE_UNKNOWN
      The bus doesn't know how to launch a service to supply the bus name you wanted.
    • NAME_HAS_NO_OWNER

      public static final DBusError NAME_HAS_NO_OWNER
      The bus name you referenced doesn't exist (i.e. no application owns it).
    • NO_REPLY

      public static final DBusError NO_REPLY
      No reply to a message expecting one, usually means a timeout occurred.
    • IO_ERROR

      public static final DBusError IO_ERROR
      Something went wrong reading or writing to a socket, for example.
    • BAD_ADDRESS

      public static final DBusError BAD_ADDRESS
      A D-Bus bus address was malformed.
    • NOT_SUPPORTED

      public static final DBusError NOT_SUPPORTED
      Requested operation isn't supported (like ENOSYS on UNIX).
    • LIMITS_EXCEEDED

      public static final DBusError LIMITS_EXCEEDED
      Some limited resource is exhausted.
    • ACCESS_DENIED

      public static final DBusError ACCESS_DENIED
      Security restrictions don't allow doing what you're trying to do.
    • AUTH_FAILED

      public static final DBusError AUTH_FAILED
      Authentication didn't work.
    • NO_SERVER

      public static final DBusError NO_SERVER
      Unable to connect to server (probably caused by ECONNREFUSED on a socket).
    • TIMEOUT

      public static final DBusError 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

      public static final DBusError NO_NETWORK
      No network access (probably ENETUNREACH on a socket).
    • ADDRESS_IN_USE

      public static final DBusError ADDRESS_IN_USE
      Can't bind a socket since its address is in use (i.e. EADDRINUSE).
    • DISCONNECTED

      public static final DBusError DISCONNECTED
      The connection is disconnected and you're trying to use it.
    • INVALID_ARGS

      public static final DBusError INVALID_ARGS
      Invalid arguments passed to a method call.
    • FILE_NOT_FOUND

      public static final DBusError FILE_NOT_FOUND
      Missing file.
    • FILE_EXISTS

      public static final DBusError FILE_EXISTS
      Existing file and the operation you're using does not silently overwrite.
    • UNKNOWN_METHOD

      public static final DBusError UNKNOWN_METHOD
      Method name you invoked isn't known by the object you invoked it on.
    • TIMED_OUT

      public static final DBusError 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

      public static final DBusError MATCH_RULE_NOT_FOUND
      Tried to remove or modify a match rule that didn't exist.
    • MATCH_RULE_INVALID

      public static final DBusError MATCH_RULE_INVALID
      The match rule isn't syntactically valid.
    • SPAWN_EXEC_FAILED

      public static final DBusError SPAWN_EXEC_FAILED
      While starting a new process, the exec() call failed.
    • SPAWN_FORK_FAILED

      public static final DBusError SPAWN_FORK_FAILED
      While starting a new process, the fork() call failed.
    • SPAWN_CHILD_EXITED

      public static final DBusError SPAWN_CHILD_EXITED
      While starting a new process, the child exited with a status code.
    • SPAWN_CHILD_SIGNALED

      public static final DBusError SPAWN_CHILD_SIGNALED
      While starting a new process, the child exited on a signal.
    • SPAWN_FAILED

      public static final DBusError SPAWN_FAILED
      While starting a new process, something went wrong.
    • SPAWN_SETUP_FAILED

      public static final DBusError SPAWN_SETUP_FAILED
      We failed to setup the environment correctly.
    • SPAWN_CONFIG_INVALID

      public static final DBusError SPAWN_CONFIG_INVALID
      We failed to setup the config parser correctly.
    • SPAWN_SERVICE_INVALID

      public static final DBusError SPAWN_SERVICE_INVALID
      Bus name was not valid.
    • SPAWN_SERVICE_NOT_FOUND

      public static final DBusError SPAWN_SERVICE_NOT_FOUND
      Service file not found in system-services directory.
    • SPAWN_PERMISSIONS_INVALID

      public static final DBusError SPAWN_PERMISSIONS_INVALID
      Permissions are incorrect on the setuid helper.
    • SPAWN_FILE_INVALID

      public static final DBusError SPAWN_FILE_INVALID
      Service file invalid (Name, User or Exec missing).
    • SPAWN_NO_MEMORY

      public static final DBusError SPAWN_NO_MEMORY
      Tried to get a UNIX process ID and it wasn't available.
    • UNIX_PROCESS_ID_UNKNOWN

      public static final DBusError UNIX_PROCESS_ID_UNKNOWN
      Tried to get a UNIX process ID and it wasn't available.
    • INVALID_SIGNATURE

      public static final DBusError INVALID_SIGNATURE
      A type signature is not valid.
    • INVALID_FILE_CONTENT

      public static final DBusError INVALID_FILE_CONTENT
      A file contains invalid syntax or is otherwise broken.
    • SELINUX_SECURITY_CONTEXT_UNKNOWN

      public static final DBusError SELINUX_SECURITY_CONTEXT_UNKNOWN
      Asked for SELinux security context and it wasn't available.
    • ADT_AUDIT_DATA_UNKNOWN

      public static final DBusError ADT_AUDIT_DATA_UNKNOWN
      Asked for ADT audit data and it wasn't available.
    • OBJECT_PATH_IN_USE

      public static final DBusError OBJECT_PATH_IN_USE
      There's already an object with the requested object path.
    • UNKNOWN_OBJECT

      public static final DBusError UNKNOWN_OBJECT
      Object you invoked a method on isn't known. Since 2.42
    • UNKNOWN_INTERFACE

      public static final DBusError UNKNOWN_INTERFACE
      Interface you invoked a method on isn't known by the object. Since 2.42
    • UNKNOWN_PROPERTY

      public static final DBusError UNKNOWN_PROPERTY
      Property you tried to access isn't known by the object. Since 2.42
    • PROPERTY_READ_ONLY

      public static final DBusError PROPERTY_READ_ONLY
      Property you tried to set is read-only. Since 2.42
  • Method Details

    • values

      public static DBusError[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DBusError valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static DBusError of(int value)
      Create a new DBusError for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static DBusError of(MemorySegment address)
      Create a new DBusError for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

      public static @Nullable Type getType()
      Get the GType of the DBusError class.
      Returns:
      the GType
    • encodeGerror

      public static String encodeGerror(GError error)

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

      If error matches a registered error (see registerError(Quark, int, String)), 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 newForDbusError(String, String).

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

      Parameters:
      error - an error
      Returns:
      a D-Bus error name
      Since:
      2.26
    • getRemoteError

      public static @Nullable String getRemoteError(GError error)

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

      This function is guaranteed to return a D-Bus error name for all GLib.Errors returned from functions handling remote method calls (for example, DBusConnection.callFinish(AsyncResult)) unless stripRemoteError(GError) has already been used on error.

      Parameters:
      error - an error
      Returns:
      an allocated string, or NULL if the D-Bus error name could not be found
      Since:
      2.26
    • isRemoteError

      public static boolean isRemoteError(GError error)

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

      If so, use getRemoteError(GError) to get the name of the error.

      Parameters:
      error - an error
      Returns:
      true if error represents an error from a remote peer; false otherwise
      Since:
      2.26
    • newForDbusError

      public static GError newForDbusError(String dbusErrorName, String dbusErrorMessage)

      Creates a GLib.Error based on the contents of dbusErrorName and dbusErrorMessage.

      Errors registered with registerError(Quark, int, String) will be looked up using dbusErrorName and if a match is found, the error domain and code is used. Applications can use getRemoteError(GError) to recover dbusErrorName.

      If a match against a registered error is not found and the D-Bus error name is in a form as returned by encodeGerror(GError) the error domain and code encoded in the name is used to create the GLib.Error. Also, dbusErrorName is added to the error message such that it can be recovered with getRemoteError(GError).

      Otherwise, a GLib.Error with the error code Gio.IOErrorEnum.DBUS_ERROR in the Gio.IOErrorEnum error domain is returned. Also, dbusErrorName is added to the error message such that it can be recovered with getRemoteError(GError).

      In all three cases, dbusErrorName can always be recovered from the returned GLib.Error using the getRemoteError(GError) function (unless stripRemoteError(GError) hasn’t been used on the returned error).

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

      Parameters:
      dbusErrorName - D-Bus error name
      dbusErrorMessage - D-Bus error message
      Returns:
      an allocated GLib.Error
      Since:
      2.26
    • quark

      public static Quark quark()
    • registerError

      public static boolean registerError(Quark errorDomain, int errorCode, String dbusErrorName)

      Creates an association mapping between dbusErrorName and GLib.Errors specified by errorDomain and errorCode.

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

      Parameters:
      errorDomain - a GLib.Quark for an error domain
      errorCode - an error code
      dbusErrorName - a D-Bus error name
      Returns:
      true if the association was created, false if it already exists
      Since:
      2.26
    • registerErrorDomain

      public static void registerErrorDomain(String errorDomainQuarkName, Out<Long> quarkVolatile, @Nullable DBusErrorEntry @Nullable [] entries)

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

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

      Parameters:
      errorDomainQuarkName - the error domain name
      quarkVolatile - return location for the GLib.Quark representing the error domain
      entries - items to register
      Since:
      2.26
    • setDbusError

      public static void setDbusError(Out<GError> error, String dbusErrorName, String dbusErrorMessage, @Nullable String format, Object... varargs)

      Sets *error to a new GLib.Error created with newForDbusError(String, String).

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

      This function does nothing if error is NULL.

      Parameters:
      error - return location for a GLib.Error
      dbusErrorName - D-Bus error name
      dbusErrorMessage - D-Bus error message
      format - printf()-style format to prepend to dbusErrorMessage, or NULL to not modify the message
      varargs - arguments for format
      Since:
      2.26
    • stripRemoteError

      public static boolean stripRemoteError(GError 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:
      error - an error
      Returns:
      true if information was stripped; false otherwise
      Since:
      2.26
    • unregisterError

      public static boolean unregisterError(Quark errorDomain, int errorCode, String dbusErrorName)
      Destroys an association previously set up with registerError(Quark, int, String).
      Parameters:
      errorDomain - a GLib.Quark for an error domain
      errorCode - an error code
      dbusErrorName - a D-Bus error name
      Returns:
      true if the association was destroyed, false if it wasn’t found
      Since:
      2.26