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
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);
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 */
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: