zoom: guess if invalid response was an auth failure
[metaproxy-moved-to-github.git] / src / filter_zoom.cpp
index 34b3084..e871b97 100644 (file)
@@ -301,6 +301,21 @@ void yf::Zoom::Backend::get_zoom_error(int *error, char **addinfo,
             *error = yaz_diag_srw_to_bib1(error0);
         else if (!strcmp(dset, "Bib-1"))
             *error = error0;
+        else if (!strcmp(dset, "ZOOM"))
+        {
+            *error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;                
+            if (error0 == ZOOM_ERROR_INIT)
+                *error = YAZ_BIB1_INIT_AC_AUTHENTICATION_SYSTEM_ERROR;
+            else if (error0 == ZOOM_ERROR_DECODE)
+            {
+                if (zoom_addinfo)
+                {
+                    if (strstr(zoom_addinfo, "Authentication") ||
+                        strstr(zoom_addinfo, "authentication"))
+                        *error = YAZ_BIB1_INIT_AC_AUTHENTICATION_SYSTEM_ERROR;
+                }
+            }
+        }
         else
             *error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;