Use YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS everywhere where
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 2 Feb 2007 12:16:38 +0000 (12:16 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 2 Feb 2007 12:16:38 +0000 (12:16 +0000)
this diagnostic is returned. Put more appropriate addinfo in case
of filter load failure during retrieval.

index/recgrs.c
index/retrieve.c

index d665864..5b0a783 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: recgrs.c,v 1.14 2007-01-22 18:15:03 adam Exp $
+/* $Id: recgrs.c,v 1.15 2007-02-02 12:16:38 adam Exp $
    Copyright (C) 1995-2007
    Index Data ApS
 
@@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 #include <yaz/log.h>
 #include <yaz/oid.h>
+#include <yaz/diagbib1.h>
 
 #include <d1_absyn.h>
 #include <idzebra/recgrs.h>
@@ -1114,7 +1115,7 @@ int zebra_grs_retrieve(void *clientData, struct recRetrieveCtrl *p,
     node = (*grs_read)(&gri);
     if (!node)
     {
-       p->diagnostic = 14;
+       p->diagnostic = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
         nmem_destroy (mem);
        return 0;
     }
@@ -1190,7 +1191,7 @@ int zebra_grs_retrieve(void *clientData, struct recRetrieveCtrl *p,
                onode = node;
                if (!(node = data1_map_record(p->dh, onode, map, mem)))
                {
-                   p->diagnostic = 14;
+                   p->diagnostic = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
                    nmem_destroy (mem);
                    return 0;
                }
@@ -1219,7 +1220,7 @@ int zebra_grs_retrieve(void *clientData, struct recRetrieveCtrl *p,
                 onode = node;
                 if (!(node = data1_map_record(p->dh, onode, map, mem)))
                 {
-                    p->diagnostic = 14;
+                    p->diagnostic = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
                     nmem_destroy (mem);
                     return 0;
                 }
index f683530..1d99883 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: retrieve.c,v 1.63 2007-01-15 15:10:17 adam Exp $
+/* $Id: retrieve.c,v 1.64 2007-02-02 12:16:38 adam Exp $
    Copyright (C) 1995-2007
    Index Data ApS
 
@@ -41,8 +41,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 static int zebra_create_record_stream(ZebraHandle zh, 
                                Record *rec,
-                               struct ZebraRecStream *stream){
-
+                               struct ZebraRecStream *stream)
+{
     RecordAttr *recordAttr = rec_init_attr(zh->reg->zei, *rec);
 
     if ((*rec)->size[recInfo_storeData] > 0)
@@ -65,7 +65,7 @@ static int zebra_create_record_stream(ZebraHandle zh,
             yaz_log (YLOG_WARN|YLOG_ERRNO, "Retrieve fail; missing file: %s",
                      full_rep);
             rec_free(rec);
-            return 14;
+            return YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
         }
         zebra_create_stream_fd(stream, fd, recordAttr->recordOffset);
     }
@@ -650,6 +650,12 @@ int zebra_record_fetch(ZebraHandle zh, zint sysno, int score,
         if (!(rt = recType_byName(zh->reg->recTypes, zh->res,
                                   file_type, &clientData)))
         {
+            char addinfo_str[100];
+
+            sprintf(addinfo_str, "Could not handle record type %.40s",
+                    file_type);
+                    
+            *addinfo = odr_strdup(odr, addinfo_str);
             return_code = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
         }
         else