From ee8a91b29a36c141c67d80d4907507db3a4bd748 Mon Sep 17 00:00:00 2001 From: Rudie Dirkx <168024+rudiedirkx@users.noreply.github.com> Date: Mon, 6 Jun 2022 16:11:40 +0200 Subject: [PATCH] Keep original unknown error message (#170) --- .../CouldNotDownloadCertificate/UnknownError.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Exceptions/CouldNotDownloadCertificate/UnknownError.php b/src/Exceptions/CouldNotDownloadCertificate/UnknownError.php index 829a4ee..aa62de0 100644 --- a/src/Exceptions/CouldNotDownloadCertificate/UnknownError.php +++ b/src/Exceptions/CouldNotDownloadCertificate/UnknownError.php @@ -6,8 +6,16 @@ class UnknownError extends CouldNotDownloadCertificate { + protected string $errorMessage; + public function __construct(string $hostName, string $errorMessage) { parent::__construct("Could not download certificate for host `{$hostName}` because {$errorMessage}"); + + $this->errorMessage = $errorMessage; + } + + public function getOriginalMessage(): string { + return $this->errorMessage; } }