Error handling


Enumerations

enum  libnfsnapi_error_t {
  LIBNFSNAPI_ERROR_NONE = 0,
  LIBNFSNAPI_ERROR_NOTIMPLEMENTED = 1,
  LIBNFSNAPI_ERROR_MEMORY = 2,
  LIBNFSNAPI_ERROR_NETWORK = 3,
  LIBNFSNAPI_ERROR_LIBCURL = 4,
  LIBNFSNAPI_ERROR_ARGUMENT = 5,
  LIBNFSNAPI_ERROR_PROTOCOL = 6
}

Functions

const char * libnfsnapi_strerror (libnfsnapi_error_t error)

Detailed Description

Errors and failures are indicated in several different ways throughout libNFSNapi, such as returning NULL, or a non-zero value. To determine the precise nature of the error, an error code is often available, either as a return value from a function, or via libnfsnapi_mgr_error.

These error codes always reference a member of the libnfsnapi_error_t enumeration; they can be turned into human-readable messages by using the libnfsnapi_strerror function.


Enumeration Type Documentation

enum libnfsnapi_error_t
 

Error codes returned by various libNFSNapi functions.

Enumerator:
LIBNFSNAPI_ERROR_NONE  No error.
LIBNFSNAPI_ERROR_NOTIMPLEMENTED  Not in libNFSNapi yet.
LIBNFSNAPI_ERROR_MEMORY  Out of memory.
LIBNFSNAPI_ERROR_NETWORK  A networking error.
LIBNFSNAPI_ERROR_LIBCURL  A problem with libcurl.
LIBNFSNAPI_ERROR_ARGUMENT  A bad argument was given.
LIBNFSNAPI_ERROR_PROTOCOL  Server broke the API protocol.

Definition at line 24 of file error.h.


Function Documentation

const char* libnfsnapi_strerror libnfsnapi_error_t  error  ) 
 

Return a textual description of an error.

Parameters:
error The error code to query.
Returns:
Error description. Do not modify or free it.

Definition at line 10 of file error.c.

Referenced by libnfsnapi_mgr_strerror().


Generated on Sat Jan 13 17:42:28 2007 for libNFSNapi by  doxygen 1.4.6