diff --git a/src/Pipelines/GitPipe.php b/src/Pipelines/GitPipe.php index b69b159..75fd641 100644 --- a/src/Pipelines/GitPipe.php +++ b/src/Pipelines/GitPipe.php @@ -34,7 +34,7 @@ public function handle($content, Closure $next) call_user_func($content['output'], 'git checkout failed: '.$checkout); } - return throw new \RuntimeException('git checkout failed: '.$checkout); + throw new \RuntimeException('git checkout failed: '.$checkout); } else { if (is_callable($content['output'])) { call_user_func($content['output'], 'Checkout success'); diff --git a/src/RepositorySource/GithubRepository.php b/src/RepositorySource/GithubRepository.php index 82dd221..64a8e46 100644 --- a/src/RepositorySource/GithubRepository.php +++ b/src/RepositorySource/GithubRepository.php @@ -15,7 +15,7 @@ public function getLatestVersion(): string { $this->checkConfig(); - return isset($this->getLatestVersionData()['message']) ? throw new \RuntimeException($this->getLatestVersionData()['message']) : $this->getLatestVersionData()['tag_name']; + return isset($this->getLatestVersionData()['message']) ? throw new \Exception($this->getLatestVersionData()['message']) : $this->getLatestVersionData()['tag_name']; } /** @@ -48,7 +48,7 @@ public function getVersions(): array $versionsData = $this->getVersionsData(); if (isset($versionsData['message'])) { - throw new \RuntimeException($versionsData['message']); + throw new \Exception($versionsData['message']); } return $versionsData->map(function ($version) { diff --git a/src/Updater.php b/src/Updater.php index 4071d39..fafb5f7 100644 --- a/src/Updater.php +++ b/src/Updater.php @@ -134,7 +134,7 @@ function ($content) { event(new Events\UpdateFailed($current_version_in_past, $version, $th->getMessage())); - return throw $th; + throw $th; } } else { $this->output('No new version available');