0001 BSTRERROR(3)
0002 ============
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 Bstrerror - Return the description for UBF error
0009
0010
0011 SYNOPSIS
0012 --------
0013 #include <ubf.h>
0014
0015 char * Bstrerror (int 'err');
0016
0017 Link with '-lubf -lnstd -lm -lpthread'
0018
0019 DESCRIPTION
0020 -----------
0021 Function returns string description of given error code. Enduro/X also logs
0022 additional information for last error state, and that information is returned
0023 in string format together with description of 'err'. Typically when error
0024 occurs, then programmer calls *Bstrerror(Berror)*, thus function will
0025 closely describe what was happened. However if programmer calls *Bstrerror()*
0026 with other error code, then message will contain the description of 'err'
0027 plus last UBF call's logged error info. Then message and *Berror* infos are
0028 stored in thread local storage (TLS).
0029
0030 RETURN VALUE
0031 ------------
0032 String containing formatted error code description plus last call's error
0033 logged info. For example:
0034
0035 ---------------------------------------------------------------------
0036
0037 ...
0038 /* call the service now! */
0039 char username[100];
0040 BFLDLEN len=sizeof(username);
0041 if (SUCCEED!=Bget(p_ub, USER_NAME, 0, buf, &len))
0042 {
0043 ret=FAIL;
0044 /* print the result */
0045 fprintf(stderr, "%s\n", Bstrerror(Berror));
0046 }
0047 ...
0048
0049 ---------------------------------------------------------------------
0050
0051
0052 ERRORS
0053 ------
0054 Function does not return any errors.
0055
0056 BUGS
0057 ----
0058 Report bugs to support@mavimax.com
0059
0060 SEE ALSO
0061 --------
0062 *Berror(3)* *B_error(3)*
0063
0064 COPYING
0065 -------
0066 (C) Mavimax, Ltd
0067