redis-cli --bigkeys / memkeys, report detailed error on dbsize failure (#8740)
When DBSIZE failed (e.g. on AUTH error), the printed error didn't reflect the reason.
This commit is contained in:
parent
0d7a17b252
commit
84414bb33f
@ -7417,8 +7417,14 @@ static int getDbSize(void) {
|
|||||||
|
|
||||||
reply = redisCommand(context, "DBSIZE");
|
reply = redisCommand(context, "DBSIZE");
|
||||||
|
|
||||||
if(reply == NULL || reply->type != REDIS_REPLY_INTEGER) {
|
if (reply == NULL) {
|
||||||
fprintf(stderr, "Couldn't determine DBSIZE!\n");
|
fprintf(stderr, "\nI/O error\n");
|
||||||
|
exit(1);
|
||||||
|
} else if (reply->type == REDIS_REPLY_ERROR) {
|
||||||
|
fprintf(stderr, "Couldn't determine DBSIZE: %s\n", reply->str);
|
||||||
|
exit(1);
|
||||||
|
} else if (reply->type != REDIS_REPLY_INTEGER) {
|
||||||
|
fprintf(stderr, "Non INTEGER response from DBSIZE!\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user