zoom: tune CCL to Z39.50 diagnostics mapping
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 24 Feb 2012 11:36:53 +0000 (12:36 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 24 Feb 2012 11:36:53 +0000 (12:36 +0100)
Throw Bib-1: 108 "Malformed query" for syntax errors and related ones;
throw Bib-1: 3 "Unsupported search" for everything else. Details from
the CCL parser is provided as additional-info.

src/filter_zoom.cpp

index 0931029..97a1fde 100644 (file)
@@ -1851,12 +1851,16 @@ next_proxy:
             switch (cerror)
             {
             case CCL_ERR_UNKNOWN_QUAL:
-                error = YAZ_BIB1_UNSUPP_USE_ATTRIBUTE;
-                break;
             case CCL_ERR_TRUNC_NOT_LEFT: 
             case CCL_ERR_TRUNC_NOT_RIGHT:
             case CCL_ERR_TRUNC_NOT_BOTH:
-                error = YAZ_BIB1_UNSUPP_TRUNCATION_ATTRIBUTE;
+#ifdef CCL_ERR_TRUNC_NOT_EMBED
+            case CCL_ERR_TRUNC_NOT_EMBED:
+#endif
+#ifdef CCL_ERR_TRUNC_NOT_SINGLE
+            case CCL_ERR_TRUNC_NOT_SINGLE:
+#endif
+                error = YAZ_BIB1_UNSUPP_SEARCH;
                 break;
             }
             log_diagnostic(package, error, addinfo);