diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index c6510ff6d8d..739c0b294d9 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -165,12 +165,13 @@ abstract class Fetcher { // File does not already exist $file = $rootFolder->newFile($this->fileName); } catch (GenericFileException $e) { - $this->logger->warning('Could not read appstore cache file, it will be refreshed', ['app' => 'appstoreFetcher', 'exception' => $e]); try { $file->delete(); - } catch (\Exception $deleteException) { + } catch (\Exception) { + $this->logger->error('Could not read appstore cache file', ['app' => 'appstoreFetcher', 'exception' => $e]); return []; } + $this->logger->warning('Could not read appstore cache file, it will be refreshed', ['app' => 'appstoreFetcher', 'exception' => $e]); $file = $rootFolder->newFile($this->fileName); } diff --git a/tests/lib/App/AppStore/Fetcher/FetcherBase.php b/tests/lib/App/AppStore/Fetcher/FetcherBase.php index bdff8b3181c..ca0eba78692 100644 --- a/tests/lib/App/AppStore/Fetcher/FetcherBase.php +++ b/tests/lib/App/AppStore/Fetcher/FetcherBase.php @@ -697,7 +697,7 @@ abstract class FetcherBase extends TestCase { return $default; }); $this->config->method('getSystemValueBool') - ->willReturnArgument(1); + ->willReturn(true); $folder = $this->createMock(ISimpleFolder::class); $corruptedFile = $this->createMock(ISimpleFile::class); @@ -724,6 +724,7 @@ abstract class FetcherBase extends TestCase { ->method('newFile') ->with($this->fileName) ->willReturn($freshFile); + $client = $this->createMock(IClient::class); $this->clientService ->expects($this->once()) @@ -742,6 +743,7 @@ abstract class FetcherBase extends TestCase { $response->method('getHeader') ->with($this->equalTo('ETag')) ->willReturn('"myETag"'); + $fileData = '{"data":[{"id":"MyNewApp","foo":"foo"},{"id":"bar"}],"timestamp":1502,"ncversion":"11.0.0.2","ETag":"\"myETag\""}'; $freshFile ->expects($this->once())