From aa759da8de503d40736224d7b53646334ff6e16a Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Tue, 11 Sep 2018 12:45:00 -0400
Subject: [PATCH] Smarter Summon error handling.

---
 .../src/VuFindSearch/Backend/Summon/Backend.php     | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Summon/Backend.php b/module/VuFindSearch/src/VuFindSearch/Backend/Summon/Backend.php
index c7bba41d696..91ff5c4c0b4 100644
--- a/module/VuFindSearch/src/VuFindSearch/Backend/Summon/Backend.php
+++ b/module/VuFindSearch/src/VuFindSearch/Backend/Summon/Backend.php
@@ -173,9 +173,16 @@ class Backend extends AbstractBackend implements RetrieveBatchInterface
                     'pageSize' => $pageSize
                 ]
             );
-            $next = $this->createRecordCollection(
-                $this->connector->query($query)
-            );
+            try {
+                $batch = $this->connector->query($query);
+            } catch (SummonException $e) {
+                throw new BackendException(
+                    $e->getMessage(),
+                    $e->getCode(),
+                    $e
+                );
+            }
+            $next = $this->createRecordCollection($batch);
             if (!$results) {
                 $results = $next;
             } else {
-- 
GitLab