Reply to caller with error
| 97 | |
| 98 | // Reply to caller with error |
| 99 | void ErrorCtx_EmitException(void) { |
| 100 | ErrorCtx *ctx = ErrorCtx_Get(); |
| 101 | ASSERT(ctx != NULL); |
| 102 | |
| 103 | if(ctx->error != NULL) { |
| 104 | RedisModuleCtx *rm_ctx = QueryCtx_GetRedisModuleCtx(); |
| 105 | RedisModule_ReplyWithError(rm_ctx, ctx->error); |
| 106 | } |
| 107 | |
| 108 | // clear error context once error emitted |
| 109 | ErrorCtx_Clear(); |
| 110 | } |
| 111 | |
| 112 | // Returns true if error is set |
| 113 | inline bool ErrorCtx_EncounteredError(void) { |
no test coverage detected