MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_ReplyWithError

Function RM_ReplyWithError

src/module.cpp:1547–1552  ·  view source on GitHub ↗

Reply with the error 'err'. * * Note that 'err' must contain all the error, including * the initial error code. The function only provides the initial "-", so * the usage is, for example: * * RedisModule_ReplyWithError(ctx,"ERR Wrong Type"); * * and not just: * * RedisModule_ReplyWithError(ctx,"Wrong Type"); * * The function always returns REDISMODULE_OK. */

Source from the content-addressed store, hash-verified

1545 * The function always returns REDISMODULE_OK.
1546 */
1547int RM_ReplyWithError(RedisModuleCtx *ctx, const char *err) {
1548 client *c = moduleGetReplyClient(ctx);
1549 if (c == NULL) return REDISMODULE_OK;
1550 addReplyErrorFormat(c,"-%s",err);
1551 return REDISMODULE_OK;
1552}
1553
1554/* Reply with a simple string (`+... \r\n` in RESP protocol). This replies
1555 * are suitable only when sending a small non-binary string with small

Callers

nothing calls this directly

Calls 2

moduleGetReplyClientFunction · 0.85
addReplyErrorFormatFunction · 0.85

Tested by

no test coverage detected