Bstrerror — Return the description for UBF error
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).
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)); } ...