Add custom exception class for failing downloads
This commit is contained in:
parent
a2b0325f5b
commit
3148affb04
25
exceptions/updates/MDDownloadException.php
Normal file
25
exceptions/updates/MDDownloadException.php
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* Custom exception class to be raised when downloading a file fails.
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
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();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user