Commit b6b96f77 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Make error messages consistent in casing

parent 537e64e9
...@@ -347,7 +347,7 @@ static int processItem(redisReader *r) { ...@@ -347,7 +347,7 @@ static int processItem(redisReader *r) {
default: default:
byte = sdscatrepr(sdsempty(),p,1); byte = sdscatrepr(sdsempty(),p,1);
redisSetReplyReaderError(r,sdscatprintf(sdsempty(), redisSetReplyReaderError(r,sdscatprintf(sdsempty(),
"protocol error, got %s as reply type byte", byte)); "Protocol error, got %s as reply type byte", byte));
sdsfree(byte); sdsfree(byte);
return -1; return -1;
} }
......
...@@ -114,7 +114,7 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port) { ...@@ -114,7 +114,7 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port) {
he = gethostbyname(addr); he = gethostbyname(addr);
if (he == NULL) { if (he == NULL) {
__redisSetError(c,REDIS_ERR_OTHER, __redisSetError(c,REDIS_ERR_OTHER,
sdscatprintf(sdsempty(),"can't resolve: %s",addr)); sdscatprintf(sdsempty(),"Can't resolve: %s",addr));
close(s); close(s);
return REDIS_ERR; return REDIS_ERR;
} }
......
...@@ -99,7 +99,7 @@ static void test_blocking_connection() { ...@@ -99,7 +99,7 @@ static void test_blocking_connection() {
test("Returns error when host cannot be resolved: "); test("Returns error when host cannot be resolved: ");
c = redisConnect((char*)"idontexist.local", 6379); c = redisConnect((char*)"idontexist.local", 6379);
test_cond(c->err == REDIS_ERR_OTHER && test_cond(c->err == REDIS_ERR_OTHER &&
strcmp(c->errstr,"can't resolve: idontexist.local") == 0); strcmp(c->errstr,"Can't resolve: idontexist.local") == 0);
redisFree(c); redisFree(c);
test("Returns error when the port is not open: "); test("Returns error when the port is not open: ");
...@@ -240,7 +240,7 @@ static void test_reply_reader() { ...@@ -240,7 +240,7 @@ static void test_reply_reader() {
ret = redisReplyReaderGetReply(reader,NULL); ret = redisReplyReaderGetReply(reader,NULL);
err = redisReplyReaderGetError(reader); err = redisReplyReaderGetError(reader);
test_cond(ret == REDIS_ERR && test_cond(ret == REDIS_ERR &&
strcasecmp(err,"protocol error, got \"@\" as reply type byte") == 0); strcasecmp(err,"Protocol error, got \"@\" as reply type byte") == 0);
redisReplyReaderFree(reader); redisReplyReaderFree(reader);
/* when the reply already contains multiple items, they must be free'd /* when the reply already contains multiple items, they must be free'd
...@@ -253,7 +253,7 @@ static void test_reply_reader() { ...@@ -253,7 +253,7 @@ static void test_reply_reader() {
ret = redisReplyReaderGetReply(reader,NULL); ret = redisReplyReaderGetReply(reader,NULL);
err = redisReplyReaderGetError(reader); err = redisReplyReaderGetError(reader);
test_cond(ret == REDIS_ERR && test_cond(ret == REDIS_ERR &&
strcasecmp(err,"protocol error, got \"@\" as reply type byte") == 0); strcasecmp(err,"Protocol error, got \"@\" as reply type byte") == 0);
redisReplyReaderFree(reader); redisReplyReaderFree(reader);
test("Works with NULL functions for reply: "); test("Works with NULL functions for reply: ");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment