Merge, better error messages
authorBrian Aker <brian@tangent.org>
Sun, 8 Apr 2012 08:40:56 +0000 (01:40 -0700)
committerBrian Aker <brian@tangent.org>
Sun, 8 Apr 2012 08:40:56 +0000 (01:40 -0700)
libtest/memcached.cc
libtest/server.cc

index 17884a17eae6da6ed7575a7d6307173b5e90921d..dd2ac1d642a1a9a1ac3fbf2e43e1c5a52f2517cf 100644 (file)
@@ -137,7 +137,6 @@ public:
     if (memcached_failed(rc) or ret == false)
     {
       Error << "libmemcached_util_ping(" << hostname() << ", " << port() << ") error: " << memcached_strerror(NULL, rc);
-      abort();
     }
 
     return ret;
index a57b44d5ca7f0dcecc48947b46793a127dcd86a0..6ff6fc3a3a24a50a3377f8640d9d332783de529c 100644 (file)
@@ -190,6 +190,7 @@ bool Server::start()
   }
 
   size_t repeat= 5;
+  _app.slurp();
   while (--repeat)
   {
     if (pid_file().empty() == false)
@@ -203,15 +204,13 @@ bool Server::start()
           continue;
         }
 
-        throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
-                             "Unable to open pidfile for: %s",
-                             _running.c_str());
         char buf[PATH_MAX];
         getcwd(buf, sizeof(buf));
         throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
-                             "Unable to open pidfile in %s for: %s",
+                             "Unable to open pidfile in %s for: %s stderr:%s",
                              buf,
-                             _running.c_str());
+                             _running.c_str(),
+                             _app.stderr_c_str());
       }
     }
   }
@@ -244,20 +243,26 @@ bool Server::start()
     // If we happen to have a pid file, lets try to kill it
     if ((pid_file().empty() == false) and (access(pid_file().c_str(), R_OK) == 0))
     {
+      _app.slurp();
       if (kill_file(pid_file()) == false)
       {
-        throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "Failed to kill off server after startup occurred, when pinging failed: %s", pid_file().c_str());
+        throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
+                             "Failed to kill off server after startup occurred, when pinging failed: %s stderr:%s",
+                             pid_file().c_str(),
+                             _app.stderr_c_str());
       }
 
       throw libtest::fatal(LIBYATL_DEFAULT_PARAM, 
-                           "Failed to ping(), waited: %u server started, having pid_file. exec: %s error:%s",
-                           this_wait, _running.c_str(), _app.stderr_c_str()); 
+                           "Failed to ping(), waited: %u server started, having pid_file. exec: %s stderr:%s",
+                           this_wait, _running.c_str(), 
+                           _app.stderr_c_str());
     }
     else
     {
       throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
-                           "Failed to ping() server started. exec: %s",
-                           _running.c_str());
+                           "Failed to ping() server started. exec: %s stderr:%s",
+                           _running.c_str(),
+                           _app.stderr_c_str());
     }
     _running.clear();
     return false;