From 8a8f1d9c4e73cbf616fff1d40ff88e521e0d9c67 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 30 Sep 2004 21:54:22 +0000 Subject: [PATCH] Server returns surrogate diagnostic 14: "System error in presenting records" when single record cannot be converted to XML. --- ztest/ztest.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ztest/ztest.c b/ztest/ztest.c index b327fdd..77e2406 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data. * See the file LICENSE for details. * - * $Id: ztest.c,v 1.64 2004-05-10 10:46:42 adam Exp $ + * $Id: ztest.c,v 1.65 2004-09-30 21:54:22 adam Exp $ */ /* @@ -489,12 +489,20 @@ int ztest_fetch(void *handle, bend_fetch_rr *r) fread (r->record, size, 1, f); fclose (f); } - else if (r->request_format == VAL_TEXT_XML && - (cp = dummy_xml_record (r->number, r->stream))) + else if (r->request_format == VAL_TEXT_XML) { - r->len = strlen(cp); - r->record = cp; - r->output_format = VAL_TEXT_XML; + if ((cp = dummy_xml_record (r->number, r->stream))) + { + r->len = strlen(cp); + r->record = cp; + r->output_format = VAL_TEXT_XML; + } + else + { + r->errcode = 14; + r->surrogate_flag = 1; + return 0; + } } else if ((cp = dummy_marc_record(r->number, r->stream))) { -- 1.7.10.4