Add specific exception class for overly short input strings

This commit is contained in:
Joshua Ramon Enslin 2023-11-04 01:56:00 +01:00
parent 22cbd94f09
commit 15f2645514
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -0,0 +1,25 @@
<?PHP
/**
* This file contains an exception class to use when an input string is too short.
*
* @file
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* This file contains an exception class to use when an input string is too short.
*/
final class MDInputStringTooShort extends MDgenericInvalidInputsException {
/**
* Error message.
*
* @return string
*/
public function errorMessage() {
//error message
return 'Input string is too short: ' . $this->getMessage();
}
}