summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f4b002)
raw | patch | inline | side by side (parent: 0f4b002)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 29 Sep 2008 19:56:10 +0000 (19:56 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 29 Sep 2008 19:56:10 +0000 (19:56 +0000) |
goes wrong with the daemon. When possible, the daemon error message is
passed through to rrd_set_error() on the client. Prior to this patch,
most error conditions would result in "Internal error", which is not very
helpful. -- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1546 a5681a0c-68f1-0310-ab6d-d61299d08faa
passed through to rrd_set_error() on the client. Prior to this patch,
most error conditions would result in "Internal error", which is not very
helpful. -- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1546 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_client.c | patch | blob | history | |
src/rrd_update.c | patch | blob | history |
diff --git a/src/rrd_client.c b/src/rrd_client.c
index 7fa98171a9ed7e72e10e65e42a32eca7b033a91a..44d4d603b7df5a11208e40f0375389cc383f3c8b 100644 (file)
--- a/src/rrd_client.c
+++ b/src/rrd_client.c
if (ret->status <= 0)
{
+ if (ret->status < 0)
+ rrd_set_error("rrdcached: %s", ret->message);
*ret_response = ret;
return (0);
}
{
close_connection ();
pthread_mutex_unlock (&lock);
+ rrd_set_error("request: socket error (%d) while talking to rrdcached",
+ status);
return (-1);
}
fflush (sh);
pthread_mutex_unlock (&lock);
if (status != 0)
+ {
+ if (status < 0)
+ rrd_set_error("request: internal error while talking to rrdcached");
return (status);
+ }
*ret_response = res;
return (0);
@@ -604,7 +612,7 @@ int rrdc_flush_if_daemon (const char *opt_daemon, const char *filename) /* {{{ *
rrd_set_error ("rrdc_flush (%s) failed with status %i.",
filename, status);
}
- } /* if (daemon_addr) */
+ } /* if (rrdc_is_connected(..)) */
return status;
} /* }}} int rrdc_flush_if_daemon */
diff --git a/src/rrd_update.c b/src/rrd_update.c
index 9d3e85466b00271daf4f34a3badb4d9cda5f2b9b..5e26055a66db2fa20244860359f137f3f0b010b6 100644 (file)
--- a/src/rrd_update.c
+++ b/src/rrd_update.c
rc = rrdc_update (argv[optind], /* file */
argc - optind - 1, /* values_num */
(void *) (argv + optind + 1)); /* values */
- if (rc != 0)
- {
+ if (rc > 0)
rrd_set_error("Failed sending the values to rrdcached: %s",
- (rc < 0)
- ? "Internal error"
- : rrd_strerror (rc));
- }
+ rrd_strerror (rc));
}
out: