From 3148affb04c4283bc0b9cd703c55d3022742594f Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Wed, 12 Apr 2023 15:26:31 +0200 Subject: [PATCH] Add custom exception class for failing downloads --- exceptions/updates/MDDownloadException.php | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 exceptions/updates/MDDownloadException.php diff --git a/exceptions/updates/MDDownloadException.php b/exceptions/updates/MDDownloadException.php new file mode 100644 index 0000000..b357e28 --- /dev/null +++ b/exceptions/updates/MDDownloadException.php @@ -0,0 +1,25 @@ + + */ +declare(strict_types = 1); + +/** + * Custom exception class to be raised when downloading a file fails. + */ +final class MDDownloadException extends Exception { + /** + * Error message. + * + * @return string + */ + public function errorMessage() { + //error message + return 'Link could not be downloaded: ' . $this->getMessage(); + + } +}