Remove some useless catch blocks
This commit is contained in:
parent
94e73c6d8b
commit
5b6e466e0c
7 changed files with 230 additions and 263 deletions
|
|
@ -13,7 +13,6 @@ class StartProxy
|
||||||
|
|
||||||
public function handle(Server $server, bool $async = true, bool $force = false): string|Activity
|
public function handle(Server $server, bool $async = true, bool $force = false): string|Activity
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$proxyType = $server->proxyType();
|
$proxyType = $server->proxyType();
|
||||||
if ((is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop || $server->isBuildServer()) && $force === false) {
|
if ((is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop || $server->isBuildServer()) && $force === false) {
|
||||||
return 'OK';
|
return 'OK';
|
||||||
|
|
@ -71,8 +70,6 @@ public function handle(Server $server, bool $async = true, bool $force = false):
|
||||||
|
|
||||||
return 'OK';
|
return 'OK';
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ class UpdateCoolify
|
||||||
|
|
||||||
public function handle($manual_update = false)
|
public function handle($manual_update = false)
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$settings = instanceSettings();
|
$settings = instanceSettings();
|
||||||
$this->server = Server::find(0);
|
$this->server = Server::find(0);
|
||||||
if (! $this->server) {
|
if (! $this->server) {
|
||||||
|
|
@ -41,9 +40,6 @@ public function handle($manual_update = false)
|
||||||
$this->update();
|
$this->update();
|
||||||
$settings->new_version_available = false;
|
$settings->new_version_available = false;
|
||||||
$settings->save();
|
$settings->save();
|
||||||
} catch (\Throwable $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function update()
|
private function update()
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,6 @@ public function link()
|
||||||
|
|
||||||
public function accept_invitation()
|
public function accept_invitation()
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$resetPassword = request()->query('reset-password');
|
$resetPassword = request()->query('reset-password');
|
||||||
$invitationUuid = request()->route('uuid');
|
$invitationUuid = request()->route('uuid');
|
||||||
$invitation = TeamInvitation::whereUuid($invitationUuid)->firstOrFail();
|
$invitation = TeamInvitation::whereUuid($invitationUuid)->firstOrFail();
|
||||||
|
|
@ -141,14 +140,10 @@ public function accept_invitation()
|
||||||
} else {
|
} else {
|
||||||
abort(401);
|
abort(401);
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function revoke_invitation()
|
public function revoke_invitation()
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$invitation = TeamInvitation::whereUuid(request()->route('uuid'))->firstOrFail();
|
$invitation = TeamInvitation::whereUuid(request()->route('uuid'))->firstOrFail();
|
||||||
$user = User::whereEmail($invitation->email)->firstOrFail();
|
$user = User::whereEmail($invitation->email)->firstOrFail();
|
||||||
if (is_null(auth()->user())) {
|
if (is_null(auth()->user())) {
|
||||||
|
|
@ -160,8 +155,5 @@ public function revoke_invitation()
|
||||||
$invitation->delete();
|
$invitation->delete();
|
||||||
|
|
||||||
return redirect()->route('team.index');
|
return redirect()->route('team.index');
|
||||||
} catch (\Throwable $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ public function __construct(public Server $server) {}
|
||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$latestVersion = get_latest_sentinel_version();
|
$latestVersion = get_latest_sentinel_version();
|
||||||
|
|
||||||
// Check if sentinel is running
|
// Check if sentinel is running
|
||||||
|
|
@ -49,8 +48,5 @@ public function handle(): void
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,8 @@ public function __construct(public Server $server) {}
|
||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$helperImage = config('coolify.helper_image');
|
$helperImage = config('coolify.helper_image');
|
||||||
$latest_version = instanceSettings()->helper_version;
|
$latest_version = instanceSettings()->helper_version;
|
||||||
instant_remote_process(["docker pull -q {$helperImage}:{$latest_version}"], $this->server, false);
|
instant_remote_process(["docker pull -q {$helperImage}:{$latest_version}"], $this->server, false);
|
||||||
} catch (\Throwable $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ public function __construct() {}
|
||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
if (! isDev() && ! isCloud()) {
|
if (! isDev() && ! isCloud()) {
|
||||||
$response = Http::retry(3, 1000)->get('https://cdn.coollabs.io/coolify/versions.json');
|
$response = Http::retry(3, 1000)->get('https://cdn.coollabs.io/coolify/versions.json');
|
||||||
if ($response->successful()) {
|
if ($response->successful()) {
|
||||||
|
|
@ -31,8 +30,5 @@ public function handle(): void
|
||||||
send_internal_notification('PullTemplatesAndVersions failed with: '.$response->status().' '.$response->body());
|
send_internal_notification('PullTemplatesAndVersions failed with: '.$response->status().' '.$response->body());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,6 @@ public function __construct(public Server $server, public $data)
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
// TODO: Swarm is not supported yet
|
// TODO: Swarm is not supported yet
|
||||||
try {
|
|
||||||
if (! $this->data) {
|
if (! $this->data) {
|
||||||
throw new \Exception('No data provided');
|
throw new \Exception('No data provided');
|
||||||
}
|
}
|
||||||
|
|
@ -199,11 +198,6 @@ public function handle()
|
||||||
$this->updateAdditionalServersStatus();
|
$this->updateAdditionalServersStatus();
|
||||||
|
|
||||||
$this->checkLogDrainContainer();
|
$this->checkLogDrainContainer();
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updateApplicationStatus(string $applicationId, string $containerStatus)
|
private function updateApplicationStatus(string $applicationId, string $containerStatus)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue