From b5f52bf01cd99d0bb2d51d158fd009690a36d042 Mon Sep 17 00:00:00 2001 From: Vasyl Melnychuk Date: Fri, 10 Jan 2020 23:34:15 +0200 Subject: [PATCH] Make error when submitting command in incorrect context more explicit So error message `ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context` will become `ERR 'get' command submitted, but only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context` --- src/server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server.c b/src/server.c index 5845a5485..3f64aaec9 100644 --- a/src/server.c +++ b/src/server.c @@ -3498,7 +3498,10 @@ int processCommand(client *c) { c->cmd->proc != unsubscribeCommand && c->cmd->proc != psubscribeCommand && c->cmd->proc != punsubscribeCommand) { - addReplyError(c,"only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context"); + addReplyErrorFormat(c, + "'%s' command submitted, but only (P)SUBSCRIBE / " + "(P)UNSUBSCRIBE / PING / QUIT allowed in this context", + c->cmd->name); return C_OK; }