MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_ReplyWithError

Function RM_ReplyWithError

app/redis-6.2.6/src/module.c:1517–1522  ·  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

1515 * The function always returns REDISMODULE_OK.
1516 */
1517int RM_ReplyWithError(RedisModuleCtx *ctx, const char *err) {
1518 client *c = moduleGetReplyClient(ctx);
1519 if (c == NULL) return REDISMODULE_OK;
1520 addReplyErrorFormat(c,"-%s",err);
1521 return REDISMODULE_OK;
1522}
1523
1524/* Reply with a simple string (`+... \r\n` in RESP protocol). This replies
1525 * 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