From: Florian Forster Date: Tue, 7 Apr 2009 07:37:09 +0000 (+0200) Subject: dbi plugin: Be more specific about unknown field types. X-Git-Tag: collectd-4.7.0~13^2~19 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2dfe59bc808f1b58226c752511318ebe9f78e34e;p=collectd.git dbi plugin: Be more specific about unknown field types. Especially print the name of the field. --- diff --git a/src/dbi.c b/src/dbi.c index 5be9cae4..ce4cd02f 100644 --- a/src/dbi.c +++ b/src/dbi.c @@ -126,10 +126,19 @@ static int cdbi_result_get_field (dbi_result res, /* {{{ */ else sstrncpy (buffer, value, buffer_size); } + /* DBI_TYPE_BINARY */ + /* DBI_TYPE_DATETIME */ else { - ERROR ("dbi plugin: cdbi_result_get: Don't know how to handle " - "source type %hu.", src_type); + const char *field_name; + + field_name = dbi_result_get_field_name (res, index); + if (field_name == NULL) + field_name = ""; + + ERROR ("dbi plugin: Column `%s': Don't know how to handle " + "source type %hu.", + field_name, src_type); return (-1); }