diff --git a/src/debug.c b/src/debug.c index 198334b9d..5068c4836 100644 --- a/src/debug.c +++ b/src/debug.c @@ -381,6 +381,13 @@ void debugCommand(redisClient *c) { addReplyMultiBulkLen(c,numkeys); for (j = 0; j < numkeys; j++) addReplyBulk(c,c->argv[keys[j]+2]); getKeysFreeResult(keys); + } else if (!strcasecmp(c->argv[1]->ptr,"error") && c->argc == 3) { + sds errstr = sdsnewlen("-",1); + + errstr = sdscatsds(errstr,c->argv[2]->ptr); + errstr = sdsmapchars(errstr,"\n\r"," ",2); /* no newlines in errors. */ + errstr = sdscatlen(errstr,"\r\n",2); + addReplySds(c,errstr); } else { addReplyErrorFormat(c, "Unknown DEBUG subcommand or wrong number of arguments for '%s'", (char*)c->argv[1]->ptr);