mirror of
https://codeberg.org/PGPainless/cert-d-java.git
synced 2024-06-16 00:24:55 +02:00
Throw detailled error message when bad data is encountered
This commit is contained in:
parent
1b63a4ac9a
commit
304d6c29e4
|
@ -51,9 +51,10 @@ public class FilenameResolver {
|
||||||
*
|
*
|
||||||
* @throws BadNameException in case the given special name is not known
|
* @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)) {
|
if (!isSpecialName(specialName)) {
|
||||||
throw new BadNameException();
|
throw new BadNameException(String.format("%s is not a known special name", specialName));
|
||||||
}
|
}
|
||||||
|
|
||||||
return new File(getBaseDirectory(), specialName);
|
return new File(getBaseDirectory(), specialName);
|
||||||
|
|
Loading…
Reference in a new issue