Programming Language PHP

Namespace Spatie\SslCertificate\Exceptions

Class CouldNotDownloadCertificate

Method/Function unknownError

Total Examples 1

1 code examples of PHP Spatie\SslCertificate\Exceptions\CouldNotDownloadCertificate::unknownError extracted from open source projects

Was this example useful?
0
                                                    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);
    }
                                            
CouldNotDownloadCertificate's Other Methods