From 80eabfa884bb10e0434ed295af99488a7c64e606 Mon Sep 17 00:00:00 2001 From: Mehran Date: Wed, 27 Mar 2024 18:37:44 +0330 Subject: [PATCH] Added proper error message on SSL certification error --- .../Pipeline/ObtainLetsEncryptCertification.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/Services/Forge/Pipeline/ObtainLetsEncryptCertification.php b/app/Services/Forge/Pipeline/ObtainLetsEncryptCertification.php index ff93d88..2f5ad0c 100644 --- a/app/Services/Forge/Pipeline/ObtainLetsEncryptCertification.php +++ b/app/Services/Forge/Pipeline/ObtainLetsEncryptCertification.php @@ -16,6 +16,7 @@ use App\Services\Forge\ForgeService; use App\Traits\Outputifier; use Closure; +use Throwable; class ObtainLetsEncryptCertification { @@ -29,12 +30,16 @@ public function __invoke(ForgeService $service, Closure $next) $this->information('Processing SSL certificate operations.'); - $service->forge->obtainLetsEncryptCertificate( - $service->server->id, - $service->site->id, - ['domains' => [$service->site->name]], - $service->setting->waitOnSsl - ); + try { + $service->forge->obtainLetsEncryptCertificate( + $service->server->id, + $service->site->id, + ['domains' => [$service->site->name]], + $service->setting->waitOnSsl + ); + } catch (Throwable $e) { + $this->fail("---> Something's wrong with SSL certification. Check your Forge site Log for more info."); + } return $next($service); }