Skip to content

Commit

Permalink
Merge pull request #93 from mehrancodes/fix-ssl-certification-error-m…
Browse files Browse the repository at this point in the history
…essage

Added proper error message on SSL certification error
  • Loading branch information
mehrancodes authored Mar 27, 2024
2 parents 3f1aa0c + 80eabfa commit e4fbd1b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions app/Services/Forge/Pipeline/ObtainLetsEncryptCertification.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use App\Services\Forge\ForgeService;
use App\Traits\Outputifier;
use Closure;
use Throwable;

class ObtainLetsEncryptCertification
{
Expand All @@ -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);
}
Expand Down

0 comments on commit e4fbd1b

Please sign in to comment.