OpenSync Errors
[OpenSync Public API]

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.
void osync_error_free (OSyncError **error)
 Frees the error so it can be reused.
osync_bool osync_error_is_set (OSyncError **error)
 Checks if the error is set.
OSyncErrorType osync_error_get_type (OSyncError **error)
 Returns the type of the error.
const char * osync_error_print (OSyncError **error)
 Returns the message of the error.
void osync_error_update (OSyncError **error, const char *format,...)
 Updates the error message.
void osync_error_duplicate (OSyncError **target, OSyncError **source)
 Duplicates the error into the target.
void osync_error_set (OSyncError **error, OSyncErrorType type, const char *format,...)
 Sets the error.
void osync_error_set_type (OSyncError **error, OSyncErrorType type)
 Sets the type of an error.


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:
error A 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:
error A 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:
error The 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:
error A pointer to a error struct to update
format The 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:
target The target error to update
source The 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:
error A pointer to a error struct to set
type The Error type to set

Definition at line 252 of file opensync_error.c.


Generated on Wed Mar 25 15:19:19 2009 for OpenSync by  doxygen 1.5.8