Vedis C/C++ API Reference - Throw an error message.
int vedis_context_throw_error(vedis_context *pCtx,int iErr,const char *zErr);
int vedis_context_throw_error_format(vedis_context *pCtx,int iErr,const char *zFormat,...);
Throw an error message inside a user installed command.
routines when invoked throw an error message inside a user installed command to the internal error log.
Note that vedis_context_throw_error() accepts a third argument which is the length of the string to output. If the nLen argument is less than zero, then zString is read up to the first zero terminator. If nLen is non-negative, then it is the maximum number of bytes read from zString.
vedis_context_throw_error_format() is a work-alike of the "printf()" family of functions from the standard C library which is used to output a formatted string.
These routines must be called from the same thread in which the application-defined function is running.
Foreign command call context.
Severity level. This can be one of the following constants (Not a combination):
Call context error such as: An unexpected number of arguments, invalid types and so forth.
Call context warning.
Call context notice.
VEDIS_OK is returned on success. Any other return value indicates failure.