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
1cab962098
commit
a3da3e592d
@ -7417,8 +7417,14 @@ static int getDbSize(void) {
|
||||
|
||||
reply = redisCommand(context, "DBSIZE");
|
||||
|
||||
if(reply == NULL || reply->type != REDIS_REPLY_INTEGER) {
|
||||
fprintf(stderr, "Couldn't determine DBSIZE!\n");
|
||||
if (reply == NULL) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user