fix(appstore): Also catch ClientException and ServerException

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Marcel Müller
2025-09-30 11:27:47 +02:00
committed by backportbot[bot]
parent e036a08fdc
commit d98d9d3c60

View File

@@ -6,7 +6,9 @@
*/
namespace OC\App\AppStore\Fetcher;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\ServerException;
use OC\Files\AppData\Factory;
use OCP\AppFramework\Http;
use OCP\AppFramework\Utility\ITimeFactory;
@@ -88,7 +90,7 @@ abstract class Fetcher {
$client = $this->clientService->newClient();
try {
$response = $client->get($this->getEndpoint(), $options);
} catch (ConnectException $e) {
} catch (ConnectException|ClientException|ServerException $e) {
$this->config->setAppValue('settings', 'appstore-fetcher-lastFailure', (string)time());
$this->logger->error('Failed to connect to the app store', ['exception' => $e]);
return [];