Remove all useless catch block useless variables.
This commit is contained in:
@@ -67,7 +67,7 @@ function format_docker_command_output_to_json($rawOutput): Collection
|
||||
return $outputLines
|
||||
->reject(fn ($line) => empty($line))
|
||||
->map(fn ($outputLine) => json_decode($outputLine, true, flags: JSON_THROW_ON_ERROR));
|
||||
} catch (\Throwable $e) {
|
||||
} catch (\Throwable) {
|
||||
return collect([]);
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ function format_docker_envs_to_json($rawOutput)
|
||||
|
||||
return [$env[0] => $env[1]];
|
||||
});
|
||||
} catch (\Throwable $e) {
|
||||
} catch (\Throwable) {
|
||||
return collect([]);
|
||||
}
|
||||
}
|
||||
@@ -510,7 +510,7 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
} catch (\Throwable) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@@ -124,7 +124,7 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d
|
||||
associative: true,
|
||||
flags: JSON_THROW_ON_ERROR
|
||||
);
|
||||
} catch (\JsonException $exception) {
|
||||
} catch (\JsonException) {
|
||||
return collect([]);
|
||||
}
|
||||
$seenCommands = collect();
|
||||
@@ -204,7 +204,7 @@ function checkRequiredCommands(Server $server)
|
||||
}
|
||||
try {
|
||||
instant_remote_process(["docker run --rm --privileged --net=host --pid=host --ipc=host --volume /:/host busybox chroot /host bash -c 'apt update && apt install -y {$command}'"], $server);
|
||||
} catch (\Throwable $e) {
|
||||
} catch (\Throwable) {
|
||||
break;
|
||||
}
|
||||
$commandFound = instant_remote_process(["docker run --rm --privileged --net=host --pid=host --ipc=host --volume /:/host busybox chroot /host bash -c 'command -v {$command}'"], $server, false);
|
||||
|
@@ -172,7 +172,7 @@ function get_latest_sentinel_version(): string
|
||||
$versions = $response->json();
|
||||
|
||||
return data_get($versions, 'coolify.sentinel.version');
|
||||
} catch (\Throwable $e) {
|
||||
} catch (\Throwable) {
|
||||
return '0.0.0';
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ function getFqdnWithoutPort(string $fqdn)
|
||||
$path = $url->getPath();
|
||||
|
||||
return "$scheme://$host$path";
|
||||
} catch (\Throwable $e) {
|
||||
} catch (\Throwable) {
|
||||
return $fqdn;
|
||||
}
|
||||
}
|
||||
@@ -540,7 +540,7 @@ function get_service_templates(bool $force = false): Collection
|
||||
$services = $response->json();
|
||||
|
||||
return collect($services);
|
||||
} catch (\Throwable $e) {
|
||||
} catch (\Throwable) {
|
||||
$services = File::get(base_path('templates/service-templates.json'));
|
||||
|
||||
return collect(json_decode($services))->sortKeys();
|
||||
@@ -1052,7 +1052,7 @@ function validate_dns_entry(string $fqdn, Server $server)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Exception) {
|
||||
}
|
||||
}
|
||||
ray("Found match: $found_matching_ip");
|
||||
@@ -2213,7 +2213,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
} elseif ($resource->getMorphClass() === \App\Models\Application::class) {
|
||||
try {
|
||||
$yaml = Yaml::parse($resource->docker_compose_raw);
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Exception) {
|
||||
return;
|
||||
}
|
||||
$server = $resource->destination->server;
|
||||
@@ -2959,7 +2959,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
||||
|
||||
try {
|
||||
$yaml = Yaml::parse($compose);
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Exception) {
|
||||
return collect([]);
|
||||
}
|
||||
|
||||
@@ -4010,7 +4010,7 @@ function loadConfigFromGit(string $repository, string $branch, string $base_dire
|
||||
]);
|
||||
try {
|
||||
return instant_remote_process($commands, $server);
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Exception) {
|
||||
// continue
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user