OpenSync  0.22
Enumerations | Functions
OpenSync Errors

OpenSync's error reporting facilities. More...

Enumerations

enum  OSyncErrorType {
  OSYNC_NO_ERROR = 0, OSYNC_ERROR_GENERIC = 1, OSYNC_ERROR_IO_ERROR = 2, OSYNC_ERROR_NOT_SUPPORTED = 3,
  OSYNC_ERROR_TIMEOUT = 4, OSYNC_ERROR_DISCONNECTED = 5, OSYNC_ERROR_FILE_NOT_FOUND = 6, OSYNC_ERROR_EXISTS = 7,
  OSYNC_ERROR_CONVERT = 8, OSYNC_ERROR_MISCONFIGURATION = 9, OSYNC_ERROR_INITIALIZATION = 10, OSYNC_ERROR_PARAMETER = 11,
  OSYNC_ERROR_EXPECTED = 12, OSYNC_ERROR_NO_CONNECTION = 13, OSYNC_ERROR_TEMPORARY = 14, OSYNC_ERROR_LOCKED = 15,
  OSYNC_ERROR_PLUGIN_NOT_FOUND = 16
}
 Defines the possible error types.
 

Functions

const char * osync_error_get_name (OSyncError **error)
 This will return a string describing the type of the error. More...
 
void osync_error_free (OSyncError **error)
 Frees the error so it can be reused. More...
 
osync_bool osync_error_is_set (OSyncError **error)
 Checks if the error is set. More...
 
OSyncErrorType osync_error_get_type (OSyncError **error)
 Returns the type of the error. More...
 
const char * osync_error_print (OSyncError **error)
 Returns the message of the error. More...
 
void osync_error_update (OSyncError **error, const char *format,...)
 Updates the error message. More...
 
void osync_error_duplicate (OSyncError **target, OSyncError **source)
 Duplicates the error into the target. More...
 
void osync_error_set (OSyncError **error, OSyncErrorType type, const char *format,...)
 Sets the error. More...
 
void osync_error_set_type (OSyncError **error, OSyncErrorType type)
 Sets the type of an error. More...
 

Detailed Description

OpenSync's error reporting facilities.

Function Documentation

const char* osync_error_get_name ( OSyncError **  error)

This will return a string describing the type of the error.

Parameters
errorA pointer to a error struct
Returns
The description, NULL on error

Definition at line 105 of file opensync_error.c.

void osync_error_free ( OSyncError **  error)
osync_bool osync_error_is_set ( OSyncError **  error)

Checks if the error is set.

Parameters
errorA pointer to a error struct to check
Returns
TRUE if the error is set, FALSE otherwise

Definition at line 137 of file opensync_error.c.

Referenced by osync_change_get_revision(), osync_error_duplicate(), osync_error_get_type(), osync_error_print(), osync_error_set_vargs(), osync_member_get_config(), and osync_member_get_config_or_default().

OSyncErrorType osync_error_get_type ( OSyncError **  error)

Returns the type of the error.

Parameters
errorThe error
Returns
The type of the error or OSYNC_NO_ERROR if no error

Definition at line 157 of file opensync_error.c.

const char* osync_error_print ( OSyncError **  error)
void osync_error_update ( OSyncError **  error,
const char *  format,
  ... 
)

Updates the error message.

You can use this function to update the error message on a error. You can use the old error->message as a parameter for this function.

Parameters
errorA pointer to a error struct to update
formatThe new message

Definition at line 187 of file opensync_error.c.

Referenced by _new_change_receiver().

void osync_error_duplicate ( OSyncError **  target,
OSyncError **  source 
)

Duplicates the error into the target.

Parameters
targetThe target error to update
sourceThe source error which to duplicate

Definition at line 212 of file opensync_error.c.

Referenced by _new_change_receiver(), osengine_reset(), osengine_sync_and_block(), and osengine_wait_sync_end().

void osync_error_set ( OSyncError **  error,
OSyncErrorType  type,
const char *  format,
  ... 
)
void osync_error_set_type ( OSyncError **  error,
OSyncErrorType  type 
)

Sets the type of an error.

Parameters
errorA pointer to a error struct to set
typeThe Error type to set

Definition at line 252 of file opensync_error.c.