Skip to content

Commit

Permalink
Fix exception throwing in GitPipe and GithubRepository classes
Browse files Browse the repository at this point in the history
  • Loading branch information
salahhusa9 committed Feb 3, 2024
1 parent 6abcf79 commit 767198d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Pipelines/GitPipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions src/RepositorySource/GithubRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}

/**
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 767198d

Please sign in to comment.