diff options
author | Binbin <binloveplay1314@qq.com> | 2023-04-12 15:11:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-12 10:11:29 +0300 |
commit | bfec2d700b8b0ccf6669e0408b5c5c75299ef47e (patch) | |
tree | 04e20c7adfdb2738f59f50f9fcc5c3f43e272556 /src/server.h | |
parent | 997fa41e99271cc5c3a79e9bf8a1332b3d9ab0c2 (diff) | |
download | redis-bfec2d700b8b0ccf6669e0408b5c5c75299ef47e.tar.gz |
Add RM_ReplyWithErrorFormat that can support format (#11923)
* Add RM_ReplyWithErrorFormat that can support format
Reply with the error create from a printf format and arguments.
If the error code is already passed in the string 'fmt', the error
code provided is used, otherwise the string "-ERR " for the generic
error code is automatically added.
The usage is, for example:
RedisModule_ReplyWithErrorFormat(ctx, "An error: %s", "foo");
RedisModule_ReplyWithErrorFormat(ctx, "-WRONGTYPE Wrong Type: %s", "foo");
The function always returns REDISMODULE_OK.
Diffstat (limited to 'src/server.h')
-rw-r--r-- | src/server.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h index 02ec91ee0..b286b6803 100644 --- a/src/server.h +++ b/src/server.h @@ -2553,6 +2553,7 @@ void setDeferredReplyBulkSds(client *c, void *node, sds s); void addReplyErrorObject(client *c, robj *err); void addReplyOrErrorObject(client *c, robj *reply); void afterErrorReply(client *c, const char *s, size_t len, int flags); +void addReplyErrorFormatInternal(client *c, int flags, const char *fmt, va_list ap); void addReplyErrorSdsEx(client *c, sds err, int flags); void addReplyErrorSds(client *c, sds err); void addReplyErrorSdsSafe(client *c, sds err); |