Low level function called by the addReplyError...() functions. * It emits the protocol for a Redis error, in the form: * * -ERRORCODE Error Message * * If the error code is already passed in the string 's', the error * code provided is used, otherwise the string "-ERR " for the generic * error code is automatically added. * Note that 's' must NOT end with \r\n. */
| 528 | * error code is automatically added. |
| 529 | * Note that 's' must NOT end with \r\n. */ |
| 530 | void addReplyErrorLength(client *c, const char *s, size_t len) { |
| 531 | /* If the string already starts with "-..." then the error code |
| 532 | * is provided by the caller. Otherwise we use "-ERR". */ |
| 533 | if (!len || s[0] != '-') addReplyProto(c,"-ERR ",5); |
| 534 | addReplyProto(c,s,len); |
| 535 | addReplyProto(c,"\r\n",2); |
| 536 | } |
| 537 | |
| 538 | /* Do some actions after an error reply was sent (Log if needed, updates stats, etc.) */ |
| 539 | void afterErrorReply(client *c, const char *s, size_t len, int severity = ERR_CRITICAL) { |
no test coverage detected