-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bc8b06
commit a603046
Showing
7 changed files
with
60 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...xceptions/CouldNotDownloadCertificate.php → ...rtificate/CouldNotDownloadCertificate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<?php | ||
|
||
namespace Spatie\SslCertificate\Exceptions; | ||
namespace Spatie\SslCertificate\Exceptions\CouldNotDownloadCertificate; | ||
|
||
use Exception; | ||
|
||
class CouldNotDownloadCertificate extends Exception | ||
{ | ||
public static function hostDoesNotExist(string $hostName): self | ||
{ | ||
return new static("The host named `{$hostName}` does not exist."); | ||
return new HostDoesNotExist($hostName); | ||
} | ||
|
||
public static function noCertificateInstalled(string $hostName): self | ||
{ | ||
return new static("Could not find a certificate on host named `{$hostName}`."); | ||
return new NoCertificateInstalled($hostName); | ||
} | ||
|
||
public static function unknownError(string $hostName, string $errorMessage): self | ||
{ | ||
return new static("Could not download certificate for host `{$hostName}` because {$errorMessage}"); | ||
return new UnknownError($hostName, $errorMessage); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Exceptions/CouldNotDownloadCertificate/HostDoesNotExist.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Spatie\SslCertificate\Exceptions\CouldNotDownloadCertificate; | ||
|
||
use Throwable; | ||
|
||
class HostDoesNotExist extends CouldNotDownloadCertificate | ||
{ | ||
public function __construct(string $hostName) | ||
{ | ||
parent::__construct("The host named `{$hostName}` does not exist."); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Exceptions/CouldNotDownloadCertificate/NoCertificateInstalled.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Spatie\SslCertificate\Exceptions\CouldNotDownloadCertificate; | ||
|
||
class NoCertificateInstalled extends CouldNotDownloadCertificate | ||
{ | ||
public function __construct(string $hostName) | ||
{ | ||
parent::__construct("Could not find a certificate on host named `{$hostName}`."); | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/Exceptions/CouldNotDownloadCertificate/UnknownError.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Spatie\SslCertificate\Exceptions\CouldNotDownloadCertificate; | ||
|
||
class UnknownError extends CouldNotDownloadCertificate | ||
{ | ||
public function __construct(string $hostName, string $errorMessage) | ||
{ | ||
parent::__construct("Could not download certificate for host `{$hostName}` because {$errorMessage}"); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters