Programming Language PHP
Namespace Spatie\SslCertificate\Exceptions
Class CouldNotDownloadCertificate
Total Examples 1
1 code examples of PHP Spatie\SslCertificate\Exceptions\CouldNotDownloadCertificate extracted from open source projects
protected function buildFailureException(string $hostName, string $errorDescription): CouldNotDownloadCertificate
{
if (str_contains($errorDescription, 'getaddrinfo') && str_contains($errorDescription, 'failed')) {
return CouldNotDownloadCertificate::hostDoesNotExist($hostName);
}
if (str_contains($errorDescription, 'error:14090086')) {
return CouldNotDownloadCertificate::noCertificateInstalled($hostName);
}
return CouldNotDownloadCertificate::unknownError($hostName, $errorDescription);
}