My application uses a config file with a lot of configurable items in it.
For instance, you can specify a custom keystore with a custom alias to be used for WebService connections (instead of the default JVM javax.net.ssl.keystore).
During runtime, we might discover that this alias does not exist in the keystore, so we might want to throw an exception. Because this is a crucial part of the application (and we can't expect the application to function properly until the config is fixed), I'm thinking throwing an Unchecked Exception is a good idea here.
Am I right in thinking that way?
Would it make sense to create a custom ConfigurationException (which extends RuntimeException) to throw in this case?
Checked Exceptions are thrown to notify the users of your methods that the method can throw a particular exception. So that the users can decide what to do when we get that exception.
If your requirement is "Application should not proceed unless the configurations are correct" and there is no method user can run to circumvent it (in try-catch block) then I do not see any reason to make it a checked Exception (Why to make users do unnecessary work if we know it is of no use).
So, in this case I would also go for unchecked Exception.