User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:api:ubf:bstrerror.3

bstrerror

Name

Bstrerror — Return the description for UBF error

Synopsis

#include <ubf.h>

char * Bstrerror (int err);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Function returns string description of given error code. Enduro/X also logs additional information for last error state, and that information is returned in string format together with description of err. Typically when error occurs, then programmer calls Bstrerror(Berror), thus function will closely describe what was happened. However if programmer calls Bstrerror() with other error code, then message will contain the description of err plus last UBF call’s logged error info. Then message and Berror infos are stored in thread local storage (TLS).

RETURN VALUE

String containing formatted error code description plus last call’s error logged info. For example:

...
    /* call the service now! */
    char username[100];
    BFLDLEN len=sizeof(username);
    if (SUCCEED!=Bget(p_ub, USER_NAME, 0, buf, &len))
    {
        ret=FAIL;
        /* print the result */
        fprintf(stderr, "%s\n", Bstrerror(Berror));
    }
...

ERRORS

Function does not return any errors.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd