Xively Official / mbed-libxively-5d6fdd4

Dependents:   xively-jumpstart-demo

Embed: (wiki syntax)

« Back to documentation index

xi_err.c File Reference

xi_err.c File Reference

Error handling (POSIX-like) [see xi_err.h]. More...

Go to the source code of this file.

Functions

xi_err_t xi_get_last_error ()
 Error getter for the user.
void xi_set_err (xi_err_t e)
 Error setter for the library itself.
const char * xi_get_error_string (xi_err_t e)
 Error description string getter for a given value of `xi_err_t`.

Variables

const char * xi_err_string [XI_ERR_COUNT]
 Error description lookup table.

Detailed Description

Error handling (POSIX-like) [see xi_err.h].

Author:
Olgierd Humenczuk

Definition in file xi_err.c.


Function Documentation

const char* xi_get_error_string ( xi_err_t  e )

Error description string getter for a given value of `xi_err_t`.

Definition at line 58 of file xi_err.c.

xi_err_t xi_get_last_error ( void   )

Error getter for the user.

Returns:
The `xi_err_t` structure which can be converted to a string using `xi_get_error_string()` method.
Warning:
It resets the last error value, so it's always a good idea to make a copy of it!

Definition at line 46 of file xi_err.c.

void xi_set_err ( xi_err_t  e )

Error setter for the library itself.

Note:
Current implementation used a global state variable (_errno_), which is not thread-safe. If thread-safety is required, than _errno_ should be made thread-local.

Definition at line 53 of file xi_err.c.


Variable Documentation

const char* xi_err_string[XI_ERR_COUNT]
Initial value:
{
          "XI_NO_ERR"
        , "XI_OUT_OF_MEMORY"                           
        , "XI_HTTP_STATUS_PARSE_ERROR"                 
        , "XI_HTTP_HEADER_PARSE_ERROR"                 
        , "XI_HTTP_PARSE_ERROR"                        
        , "XI_HTTP_ENCODE_CREATE_DATASTREAM"           
        , "XI_HTTP_ENCODE_UPDATE_DATASTREAM"           
        , "XI_HTTP_ENCODE_GET_DATASTREAM"              
        , "XI_HTTP_ENCODE_DELETE_DATASTREAM"           
        , "XI_HTTP_ENCODE_DELETE_DATAPOINT"            
        , "XI_HTTP_ENCODE_DELETE_RANGE_DATAPOINT"      
        , "XI_HTTP_ENCODE_UPDATE_FEED"                 
        , "XI_HTTP_CONSTRUCT_REQUEST_BUFFER_OVERRUN"   
        , "XI_HTTP_CONSTRUCT_CONTENT_BUFFER_OVERRUN"   
        , "XI_CSV_ENCODE_DATAPOINT_BUFFER_OVERRUN"     
        , "XI_CSV_ENCODE_DATASTREAM_BUFFER_OVERRUN"    
        , "XI_CSV_DECODE_FEED_PARSER_ERROR"            
        , "XI_CSV_DECODE_DATAPOINT_PARSER_ERROR"       
        , "XI_CSV_TIME_CONVERTION_ERROR"               
        , "XI_SOCKET_INITIALIZATION_ERROR"             
        , "XI_SOCKET_GETHOSTBYNAME_ERROR"              
        , "XI_SOCKET_CONNECTION_ERROR"                 
        , "XI_SOCKET_SHUTDOWN_ERROR"                   
        , "XI_SOCKET_WRITE_ERROR"                      
        , "XI_SOCKET_READ_ERROR"                       
        , "XI_SOCKET_CLOSE_ERROR"                      
        , "XI_DATAPOINT_VALUE_BUFFER_OVERFLOW"         
}

Error description lookup table.

Definition at line 15 of file xi_err.c.