From: Sebastian Harl Date: Tue, 10 Mar 2009 19:48:54 +0000 (+0100) Subject: configfile, types_list: Improved error messages when handling "TypesDB". X-Git-Tag: collectd-4.6.2~2^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=cc5c9640e4e5b766473e227d38ee24c123d9bea6;p=collectd.git configfile, types_list: Improved error messages when handling "TypesDB". --- diff --git a/src/configfile.c b/src/configfile.c index bb57ca26..580b24b6 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -205,13 +205,18 @@ static int dispatch_value_typesdb (const oconfig_item_t *ci) cf_default_typesdb = 0; - if (ci->values_num < 1) + if (ci->values_num < 1) { + ERROR ("configfile: `TypesDB' needs at least one argument."); return (-1); + } for (i = 0; i < ci->values_num; ++i) { - if (OCONFIG_TYPE_STRING != ci->values[i].type) + if (OCONFIG_TYPE_STRING != ci->values[i].type) { + WARNING ("configfile: TypesDB: Skipping %i. argument which " + "is not a string.", i + 1); continue; + } read_types_list (ci->values[i].value.string); } diff --git a/src/types_list.c b/src/types_list.c index 7600c346..ed832fee 100644 --- a/src/types_list.c +++ b/src/types_list.c @@ -172,7 +172,9 @@ int read_types_list (const char *file) if (fh == NULL) { char errbuf[1024]; - ERROR ("open (%s) failed: %s", + fprintf (stderr, "Failed to open types database `%s': %s.\n", + file, sstrerror (errno, errbuf, sizeof (errbuf))); + ERROR ("Failed to open types database `%s': %s", file, sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); }