Throw detailled error message when bad data is encountered

This commit is contained in:
Paul Schaub 2022-07-04 19:41:02 +02:00
parent 1b63a4ac9a
commit 304d6c29e4
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 3 additions and 2 deletions

View File

@ -51,9 +51,10 @@ public class FilenameResolver {
*
* @throws BadNameException in case the given special name is not known
*/
public File getCertFileBySpecialName(String specialName) throws BadNameException {
public File getCertFileBySpecialName(String specialName)
throws BadNameException {
if (!isSpecialName(specialName)) {
throw new BadNameException();
throw new BadNameException(String.format("%s is not a known special name", specialName));
}
return new File(getBaseDirectory(), specialName);