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

Function addReplyErrorLength

app/redis-6.2.6/src/networking.c:410–416  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

408 * error code is automatically added.
409 * Note that 's' must NOT end with \r\n. */
410void addReplyErrorLength(client *c, const char *s, size_t len) {
411 /* If the string already starts with "-..." then the error code
412 * is provided by the caller. Otherwise we use "-ERR". */
413 if (!len || s[0] != '-') addReplyProto(c,"-ERR ",5);
414 addReplyProto(c,s,len);
415 addReplyProto(c,"\r\n",2);
416}
417
418/* Do some actions after an error reply was sent (Log if needed, updates stats, etc.) */
419void afterErrorReply(client *c, const char *s, size_t len) {

Callers 3

addReplyErrorFunction · 0.85
addReplyErrorSdsFunction · 0.85
addReplyErrorFormatFunction · 0.85

Calls 1

addReplyProtoFunction · 0.85

Tested by

no test coverage detected