An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
refactor(error-handling): replace generic Exception with RuntimeException for improved error specificity
Andras Bacsai2361c34a537e
diff --git a/app/Actions/Service/DeleteService.php b/app/Actions/Service/DeleteService.phpindex 372ffe3970..404e115594 100644--- a/app/Actions/Service/DeleteService.php+++ b/app/Actions/Service/DeleteService.php@@ -53,7 +53,7 @@ class DeleteServiceinstant_remote_process(["docker rm -f $service->uuid"], $server, throwError: false);} catch (\Exception $e) {- throw new \Exception($e->getMessage());+ throw new \RuntimeException($e->getMessage());} finally {if ($deleteConfigurations) {$service->deleteConfigurations();diff --git a/app/Models/Application.php b/app/Models/Application.phpindex 7929aadc15..f3f063d197 100644--- a/app/Models/Application.php+++ b/app/Models/Application.php@@ -1289,7 +1289,7 @@ class Application extends BaseModeltry {$yaml = Yaml::parse($this->docker_compose_raw);} catch (\Exception $e) {- throw new \Exception($e->getMessage());+ throw new \RuntimeException($e->getMessage());}$services = data_get($yaml, 'services');diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.phpindex 7d6d55c5d2..7e4dd121a8 100644--- a/bootstrap/helpers/shared.php+++ b/bootstrap/helpers/shared.php@@ -599,7 +599,7 @@ function getTopLevelNetworks(Service|Application $resource)try {$yaml = Yaml::parse($resource->docker_compose_raw);} catch (\Exception $e) {- throw new \Exception($e->getMessage());+ throw new \RuntimeException($e->getMessage());}$services = data_get($yaml, 'services');$topLevelNetworks = collect(data_get($yaml, 'networks', []));@@ -653,7 +653,7 @@ function getTopLevelNetworks(Service|Application $resource)try {$yaml = Yaml::parse($resource->docker_compose_raw);} catch (\Exception $e) {- throw new \Exception($e->getMessage());+ throw new \RuntimeException($e->getMessage());}$server = $resource->destination->server;$topLevelNetworks = collect(data_get($yaml, 'networks', []));@@ -1435,7 +1435,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = faltry {$yaml = Yaml::parse($resource->docker_compose_raw);} catch (\Exception $e) {- throw new \Exception($e->getMessage());+ throw new \RuntimeException($e->getMessage());}$allServices = get_service_templates();$topLevelVolumes = collect(data_get($yaml, 'volumes', []));