[BUGFIX] Catch guzzle exceptions in getUrl.
If a location is not accessible, guzzle with throw an exception. This will stop the CLI indexing or reindexing job. In the backend this exception is shown on saving documents.
This commit is contained in:
parent
dcd4104ce0
commit
4e64a036eb
|
@ -909,7 +909,12 @@ class Helper
|
|||
'User-Agent' => $extConf['useragent'] ?? 'Kitodo.Presentation Proxy',
|
||||
],
|
||||
];
|
||||
$response = $requestFactory->request($url, 'GET', $configuration);
|
||||
try {
|
||||
$response = $requestFactory->request($url, 'GET', $configuration);
|
||||
} catch (\Exception $e) {
|
||||
self::log('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.', LOG_SEVERITY_WARNING);
|
||||
return false;
|
||||
}
|
||||
$content = $response->getBody()->getContents();
|
||||
|
||||
return $content;
|
||||
|
|
Loading…
Reference in New Issue