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. */
| 1545 | * The function always returns REDISMODULE_OK. |
| 1546 | */ |
| 1547 | int 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 |
nothing calls this directly
no test coverage detected