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