| gumd API Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <gum/common/gum-error.h> #define GUM_ERROR #define GUM_GET_ERROR_FOR_ID (code, message, ...) #define GUM_RETURN_WITH_ERROR (code, err_str, err, retval) #define GUM_SET_ERROR (code, err_str, err, retvar, retval) enum GumError; GError * gum_error_new_from_variant (GVariant *var); GQuark gum_error_quark (void); GVariant * gum_error_to_variant (GError *error);
This file provides Gum error definitions and utilities. When creating an error, use GUM_ERROR for the error domain and errors from GumError for the error code.
GError* err = g_error_new(GUM_ERROR, GUM_ERROR_USER_ALREADY_EXISTS,
"User already exists");
#define GUM_ERROR (gum_error_quark())
This macro should be used when creating a GError (for example with
g_error_new()).
#define GUM_GET_ERROR_FOR_ID(code, message, args...)
A helper macro that creates a GError with the proper gum domain
|
A GumError specifying the error |
|
Format string for the error message |
|
parameters for the error string |
#define GUM_RETURN_WITH_ERROR(code, err_str, err, retval)
A helper macro that creates a GError with the proper gum domain, output the error message to logs, and returns with specified retval.
#define GUM_SET_ERROR(code, err_str, err, retvar, retval)
A helper macro that creates a GError with the proper gum domain, output the error message to logs, and sets the specified retval to retvar.
typedef enum {
GUM_ERROR_NONE,
GUM_ERROR_UNKNOWN = 1,
GUM_ERROR_INTERNAL_SERVER,
GUM_ERROR_PERMISSION_DENIED,
GUM_ERROR_USER_ALREADY_EXISTS = 32,
GUM_ERROR_USER_GROUP_ADD_FAILURE,
GUM_ERROR_USER_UID_NOT_AVAILABLE,
GUM_ERROR_USER_INVALID_USER_TYPE,
GUM_ERROR_USER_SECRET_ENCRYPT_FAILURE,
GUM_ERROR_USER_NOT_FOUND,
GUM_ERROR_USER_INVALID_DATA,
GUM_ERROR_USER_GROUP_DELETE_FAILURE,
GUM_ERROR_USER_SELF_DESTRUCTION,
GUM_ERROR_USER_SESSION_TERM_FAILURE,
GUM_ERROR_USER_NO_CHANGES,
GUM_ERROR_USER_LOCK_FAILURE,
GUM_ERROR_GROUP_ALREADY_EXISTS = 64,
GUM_ERROR_GROUP_GID_NOT_AVAILABLE,
GUM_ERROR_GROUP_INVALID_GROUP_TYPE,
GUM_ERROR_GROUP_SECRET_ENCRYPT_FAILURE,
GUM_ERROR_GROUP_NOT_FOUND,
GUM_ERROR_GROUP_USER_ALREADY_A_MEMBER,
GUM_ERROR_GROUP_INVALID_DATA,
GUM_ERROR_GROUP_SELF_DESTRUCTION,
GUM_ERROR_GROUP_HAS_USER,
GUM_ERROR_GROUP_NO_CHANGES,
GUM_ERROR_DB_ALREADY_LOCKED = 90,
GUM_ERROR_FILE_OPEN,
GUM_ERROR_FILE_ATTRIBUTE,
GUM_ERROR_FILE_MOVE,
GUM_ERROR_FILE_WRITE,
GUM_ERROR_HOME_DIR_CREATE_FAILURE,
GUM_ERROR_HOME_DIR_DELETE_FAILURE,
GUM_ERROR_HOME_DIR_COPY_FAILURE,
GUM_ERROR_INVALID_NAME = 120,
GUM_ERROR_INVALID_NICKNAME,
GUM_ERROR_INVALID_SECRET = 130,
GUM_ERROR_INVALID_STR = 140,
GUM_ERROR_INVALID_STR_LEN,
GUM_ERROR_INVALID_INPUT = 160,
GUM_ERROR_USER_ERR = 400
} GumError;
This enumeration provides a list of errors
| No error | |
| Catch-all for errors not distinguished by another error code | |
| Server internal error | |
| The operation cannot be performed due to insufficient client permissions | |
| User already exists | |
| Adding/creating groups for the user failure | |
| UID not available in the defined range | |
| Usertype is not set | |
| Encryption of secret failure | |
| User not found | |
| Invalid data provided in the request | |
| Deleting group for the user failure | |
| Self-destruction is not allowed | |
| Session termination of a user failure | |
| No changes specified in the user update request | |
| Unable to lock the user account before doing any changes | |
| Group already exists | |
| GID mot available in the defined range | |
| Group type not set | |
| Encryption of group secret failure | |
| Group not found | |
| User is already a member of the group | |
| Invalid data is specified in the request | |
| Self-destruction is not allowed | |
| Group has (other) user(s) | |
| No changes specified in the group update request | |
| Database is already locked | |
| File open error | |
| File attribute error | |
| File move error | |
| File write error | |
| Directory create failure | |
| Directory delete failure | |
| Directory copy failure | |
| Invalid name specified | |
| Invalid nickname specified | |
| Invalid secret specified | |
| Invalid string specified | |
| Invalid string length | |
| Invalid input specified | |
| Placeholder to rearrange enumeration - User space specific |
GError * gum_error_new_from_variant (GVariant *var);
Converts the GVariant to GError.
GQuark gum_error_quark (void);
Creates and returns a domain for Gum errors.
Returns : |
GQuark for Gum errors |