Conversation
| try (InputStream input = GpgTestUtils.class.getResourceAsStream(pgpKeyResourceName)) { | ||
| if (input == null) { | ||
| throw new IllegalArgumentException("Secret GPG file not found: " + pgpKeyResourceName); | ||
| throw new IOException("Secret GPG file not found: " + pgpKeyResourceName); |
There was a problem hiding this comment.
The problem here is not the argument. The problem is in the file system external to the program, which suggests a checked exception.
There was a problem hiding this comment.
This is looked up from the classloader not the filesystem
There was a problem hiding this comment.
Nonetheless, it's still external. Unless maybe this is compiled into the plugin's own jar? In which case, IllegalArgumentException is still wrong. Instead it should be something like MissingResourceException
There was a problem hiding this comment.
This is in all cases I can think of a programming mistake therefore unchecked exceptions seems to be fine to me. Which unchecked exception does not really matter to me
There was a problem hiding this comment.
MissingResourceException is only for ResourceBundles.
|
@elharo Please assign appropriate label to PR according to the type of change. |
This is all test code so it's a safe change as long as test pass
starts on #1298