Symisc Vedis

An Embeddable Datastore Engine



Vedis C/C++ API Reference - Throw an error message.

Syntax

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.


Description


These 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 accepts as their first argument a pointer to a vedis_context which mean that they are designed to be invoked only from a foreign command.


These routines must be called from the same thread in which the application-defined function is running.


Parameters


pCtx

 Foreign command call context.

iErr

Severity level. This can be one of the following constants (Not a combination):

VEDIS_CTX_ERR

Call context error such as: An unexpected number of arguments, invalid types and so forth.

VEDIS_CTX_WARNING

Call context warning.

VEDIS_CTX_NOTICE

Call context notice.


Return value


VEDIS_OK is returned on success. Any other return value indicates failure.


See also


vedis_register_command.



Symisc Systems
Copyright © Symisc Systems