Add exception for invalid currencies
This commit is contained in:
parent
7ed9502290
commit
63759b8636
29
exceptions/updates/MDInvalidCurrency.php
Normal file
29
exceptions/updates/MDInvalidCurrency.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?PHP
|
||||
/**
|
||||
* This file contains an exception class for usage of unaccepted currencies.
|
||||
*
|
||||
* @file
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
*/
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Custom exception class to be raised when trying to use a currency that is not
|
||||
* accepted by museum-digital.
|
||||
*/
|
||||
class MDInvalidCurrency extends MDgenericInvalidInputsException {
|
||||
|
||||
/**
|
||||
* Error message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage() {
|
||||
//error message
|
||||
$errorMsg = 'The following currency is not available: ' . $this->getMessage();
|
||||
return $errorMsg;
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user