diff --git a/module/VuFind/src/VuFind/Content/ObalkyKnihService.php b/module/VuFind/src/VuFind/Content/ObalkyKnihService.php index aff0b28f2877b714711487ee4e79eca7a647c44f..af1de003cdaa91ae22809f07dc53648df3ecfd51 100644 --- a/module/VuFind/src/VuFind/Content/ObalkyKnihService.php +++ b/module/VuFind/src/VuFind/Content/ObalkyKnihService.php @@ -163,7 +163,12 @@ class ObalkyKnihService implements \VuFindHttp\HttpServiceAwareInterface, $url = $this->apiUrl . "?"; $url .= http_build_query([$param => json_encode([$query])]); $client = $this->getHttpClient($url); - $response = $client->send(); + try { + $response = $client->send(); + } catch (\Exception $e) { + $this->logError('Unexpected ' . get_class($e) . ': ' . $e->getMessage()); + return null; + } return $response->isSuccess() ? json_decode($response->getBody())[0] : null; } }