From: Brian Aker Date: Sun, 8 Apr 2012 08:40:56 +0000 (-0700) Subject: Merge, better error messages X-Git-Tag: 1.0.7~10^2^2^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3dcd41c50068eec906a1a11a178e9b3f08ef2326;p=m6w6%2Flibmemcached Merge, better error messages --- diff --git a/libtest/memcached.cc b/libtest/memcached.cc index 17884a17..dd2ac1d6 100644 --- a/libtest/memcached.cc +++ b/libtest/memcached.cc @@ -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; diff --git a/libtest/server.cc b/libtest/server.cc index a57b44d5..6ff6fc3a 100644 --- a/libtest/server.cc +++ b/libtest/server.cc @@ -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;