diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-04-11 00:05:42 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-04-11 10:08:23 +0200 |
commit | 3d80ade8d73c56dcd8b7a6d0c88aa965b77a53e6 (patch) | |
tree | e72ce56bdaebdce00559b0f43035a322c84d90a7 /lib/private/App/AppStore | |
parent | ac939e8fd4d6fd248a5ebf63a5e86edb6dcdaf3b (diff) | |
download | nextcloud-server-3d80ade8d73c56dcd8b7a6d0c88aa965b77a53e6.tar.gz nextcloud-server-3d80ade8d73c56dcd8b7a6d0c88aa965b77a53e6.zip |
Log possible exception caused by wrong version number
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/App/AppStore')
-rw-r--r-- | lib/private/App/AppStore/Fetcher/AppFetcher.php | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index 89bc7eb2c4f..5203515e09b 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -33,6 +33,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Http\Client\IClientService; use OCP\IConfig; use OCP\ILogger; +use OCP\Util; class AppFetcher extends Fetcher { @@ -87,16 +88,20 @@ class AppFetcher extends Fetcher { if($release['isNightly'] === false && strpos($release['version'], '-') === false) { // Exclude all versions not compatible with the current version - $versionParser = new VersionParser(); - $version = $versionParser->getVersion($release['rawPlatformVersionSpec']); - $ncVersion = $this->getVersion(); - $min = $version->getMinimumVersion(); - $max = $version->getMaximumVersion(); - $minFulfilled = $this->compareVersion->isCompatible($ncVersion, $min, '>='); - $maxFulfilled = $max !== '' && - $this->compareVersion->isCompatible($ncVersion, $max, '<='); - if ($minFulfilled && $maxFulfilled) { - $releases[] = $release; + try { + $versionParser = new VersionParser(); + $version = $versionParser->getVersion($release['rawPlatformVersionSpec']); + $ncVersion = $this->getVersion(); + $min = $version->getMinimumVersion(); + $max = $version->getMaximumVersion(); + $minFulfilled = $this->compareVersion->isCompatible($ncVersion, $min, '>='); + $maxFulfilled = $max !== '' && + $this->compareVersion->isCompatible($ncVersion, $max, '<='); + if ($minFulfilled && $maxFulfilled) { + $releases[] = $release; + } + } catch (\InvalidArgumentException $e) { + $this->logger->logException($e, ['app' => 'appstoreFetcher', 'level' => Util::WARN]); } } } |