From 4378b9336fd87319130b352ea0f28e4523c02405 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Sat, 25 Jul 2026 10:02:06 -0400 Subject: [PATCH] GeniePlus: fix Guzzle error handling. --- src/RecordManager/Base/Harvest/GeniePlus.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/RecordManager/Base/Harvest/GeniePlus.php b/src/RecordManager/Base/Harvest/GeniePlus.php index 51a30575..e376b4b9 100644 --- a/src/RecordManager/Base/Harvest/GeniePlus.php +++ b/src/RecordManager/Base/Harvest/GeniePlus.php @@ -5,7 +5,7 @@ * * PHP version 8 * - * Copyright (c) Villanova University 2022. + * Copyright (c) Villanova University 2022-2026. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -401,7 +401,11 @@ protected function sendRequest($path, $params): MessageInterface for ($try = 1; $try <= $maxTries; $try++) { $this->infoMsg("Sending request: $url"); try { - $response = $client->get($url, compact('headers')); + try { + $response = $client->get($url, compact('headers')); + } catch (\GuzzleHttp\Exception\BadResponseException $e) { + $response = $e->getResponse(); + } $code = $response->getStatusCode(); if ($code == 404) { return $response;