From: Sebastian Harl Date: Sun, 15 Mar 2015 14:45:53 +0000 (-0400) Subject: analyzer: Improve some error messages. X-Git-Tag: sysdb-0.8.0~119 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=abb97cfebfcca78912dc8315aa8b9c9c81d6ea2a;p=sysdb.git analyzer: Improve some error messages. --- diff --git a/src/frontend/analyzer.c b/src/frontend/analyzer.c index bef6b1d..cf077de 100644 --- a/src/frontend/analyzer.c +++ b/src/frontend/analyzer.c @@ -45,7 +45,7 @@ iter_error(sdb_strbuf_t *errbuf, int op, sdb_store_expr_t *iter, int context) sdb_strbuf_sprintf(errbuf, "Invalid %s iterator: %s %s " "not iterable in %s context", MATCHER_SYM(op), EXPR_TO_STRING(iter), SDB_STORE_TYPE_TO_NAME(iter->data_type), - SDB_STORE_TYPE_TO_NAME(context)); + context == -1 ? "generic" : SDB_STORE_TYPE_TO_NAME(context)); } /* iter_error */ static void @@ -392,13 +392,15 @@ sdb_fe_analyze(sdb_conn_node_t *node, sdb_strbuf_t *errbuf) } else { sdb_strbuf_sprintf(errbuf, - "Don't know how to analyze command %#x", node->cmd); + "Don't know how to analyze %s command (id=%#x)", + SDB_CONN_MSGTYPE_TO_STRING(node->cmd), node->cmd); return -1; } if (context <= 0) { sdb_strbuf_sprintf(errbuf, "Unable to determine the context " - "(object type) for command %#x", node->cmd); + "(object type) for %s command (id=%#x)", + SDB_CONN_MSGTYPE_TO_STRING(node->cmd), node->cmd); return -1; } if (analyze_matcher(context, -1, m, errbuf))