From b2d8fc833e5f604df069deb5b16a76b6e03a0e61 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 1 Mar 2012 15:17:00 +0100 Subject: [PATCH] record_conv: proper diagnostic for unhandled types Thanks to Hudson for telling me. --- src/record_conv.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/record_conv.c b/src/record_conv.c index c6ce964..3caf06c 100644 --- a/src/record_conv.c +++ b/src/record_conv.c @@ -495,14 +495,17 @@ int yaz_record_conv_configure(yaz_record_conv_t p, const xmlNode *ptr) { wrbuf_rewind(p->wr_error); info = t->construct(p, ptr, p->path, p->wr_error); - if (info) + + if (info || wrbuf_len(p->wr_error)) break; + /* info== 0 and no error reported , ie not handled by it */ } if (!info) { - wrbuf_printf(p->wr_error, "Element : expected " - " or element, got <%s>" - , ptr->name); + if (wrbuf_len(p->wr_error) == 0) + wrbuf_printf(p->wr_error, "Element : expected " + " or element, got <%s>" + , ptr->name); return -1; } r = (struct yaz_record_conv_rule *) nmem_malloc(p->nmem, sizeof(*r)); -- 1.7.10.4