Error Codes
[Protocol-Independent API]


Detailed Description

miniRPC functions return two distinct classes of error codes. Most protocol-independent functions return an int: 0 for success, or a positive POSIX error code (e.g. EINVAL) on error. Most protocol-dependent functions return an mrpc_status_t, which is defined as follows:

  1. Zero (or MINIRPC_OK) indicates success, while a nonzero value indicates an error.
  2. Negative error codes are errors produced by miniRPC; these might have been produced locally, or might have been received over the network from the remote host. These error codes are defined in enum mrpc_status_codes, and may be mapped to an error message with mrpc_strerror().
  3. Positive error codes are defined by the particular protocol, and always originate from the remote host.


Typedefs

typedef int mrpc_status_t
 Error code returned by protocol operations.

Enumerations

enum  mrpc_status_codes {
  MINIRPC_OK = 0, MINIRPC_PENDING = -1, MINIRPC_ENCODING_ERR = -2, MINIRPC_PROCEDURE_UNAVAIL = -3,
  MINIRPC_INVALID_ARGUMENT = -4, MINIRPC_INVALID_PROTOCOL = -5, MINIRPC_NETWORK_FAILURE = -6
}
 Error codes defined by miniRPC. More...

Functions

const char * mrpc_strerror (mrpc_status_t status)
 Return a brief description of the specified miniRPC error code.


Enumeration Type Documentation

Error codes defined by miniRPC.

Parameters:
MINIRPC_OK Success
MINIRPC_PENDING Special return code used by request handlers to indicate that they will complete the request asynchronously
MINIRPC_ENCODING_ERR An error occurred during serialization/deserialization
MINIRPC_PROCEDURE_UNAVAIL The requested procedure is not available at this time
MINIRPC_INVALID_ARGUMENT An invalid argument was provided
MINIRPC_INVALID_PROTOCOL The implied protocol role does not match the connection
MINIRPC_NETWORK_FAILURE The action could not be completed due to a temporary or permanent network problem


Function Documentation

const char* mrpc_strerror ( mrpc_status_t  status  ) 

Return a brief description of the specified miniRPC error code.

Parameters:
status The error code
Returns:
A description of the error
The returned string must not be modified or freed by the application. This function only understands the error codes defined in enum mrpc_status_codes; application-specific error codes will be mapped to a generic description.


miniRPC 0.3.3
Documentation generated by Doxygen 1.5.6