summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2020-01-15 17:53:51 +0100
committerGitHub <noreply@github.com>2020-01-15 17:53:51 +0100
commit456bbc02c8b5161e8e49b926325cdb54a69d12bb (patch)
tree7090e92340aab14fb5e723a7151e02ac2e409b0d
parent2d7dc71b6fcf1638338f2d24d2d9c94297157416 (diff)
parentb5f52bf01cd99d0bb2d51d158fd009690a36d042 (diff)
downloadredis-456bbc02c8b5161e8e49b926325cdb54a69d12bb.tar.gz
Merge pull request #6775 from SqREL/make-error-of-invalid-command-withing-context-explicit
Make error when submitting command in incorrect context more explicit
-rw-r--r--src/server.c5
1 files changed, 4 insertions, 1 deletions
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;
}