Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-friendly error from credis-test when Redis server is not present #23

Closed
GoogleCodeExporter opened this issue Nov 3, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

credis-test.c will segfault if a connection to the redis server cannot be made. 
 There is no error handling, so this is confusing to the new user.  Here is a 
trivial patch to fix it:

--- credis-test.c.old   2010-05-19 16:50:09.000000000 -0400
+++ credis-test.c   2010-07-18 00:58:41.508511597 -0400
@@ -73,6 +73,10 @@

 int main(int argc, char **argv) {
   REDIS redis = credis_connect(NULL, 0, 10000);
+  if (redis == NULL) {
+    printf("Error connecting to Redis server.  Please start server to run 
tests.\n");
+    exit(1);
+  }
   REDIS_INFO info;
   char *val, **valv, lstr[50000];
   const char *keyv[] = {"kalle", "adam", "unknown", "bertil", "none"};

Original issue reported on code.google.com by aaron.hamid on 18 Jul 2010 at 5:01

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r43.

Original comment by romf...@gmail.com on 21 Jul 2010 at 7:46

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant