Add exception to be thrown when an invalid PGP key is submitted

This commit is contained in:
Joshua Ramon Enslin 2023-07-15 22:43:51 +02:00
parent a769e1ea35
commit ded07b6597
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -0,0 +1,26 @@
<?PHP
/**
* This file contains an exception class to be raised if a submitted PGP key
* is invalid.
*
* @file
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Custom exception class to be raised if a submitted PGP key is not valid.
*/
final class MDPgpKeyIsInvalid extends MDgenericInvalidInputsException {
/**
* Error message.
*
* @return string
*/
public function errorMessage() {
//error message
return 'PGP key is invalid. ' . $this->getMessage();
}
}