C Client error handling

For C Client applications, functions return an error code of type E_BNS_ERROR_CODE, which is defined in the header file bnsErrorCodes.h.

When no errors are detected, the return value is _BNS_OK (0).

To get extended error information, use the following function:

bns__ErrorInfo* bns__get_last_error(bns__Connection client)

The struct bns__ErrorInfo, which is defined in the bnsDataStructs.h header file, contains the error code and a textual description of the error:

struct bns__ErrorInfo

{

    E_BNS_ERROR_CODE error_code;

    wchar_t *description;

};

Possible errors can be grouped together as follows:

Communication errors

The following list shows typical errors that might occur when communication problems with the system occur.

Host not found
The host name is not valid.
Timeout
The web server not running or the port number is incorrect.
HTTP error
The URL is incomplete or inaccurate.
HTTP/1.1 405 Method not allowed
The URL is incomplete or inaccurate.