Make decryption code fail-fast AFTER logging the error.
This commit is contained in:
@@ -198,15 +198,15 @@ public class EnvironmentDecryptApplicationInitializer implements
|
||||
}
|
||||
catch (Exception e) {
|
||||
String message = "Cannot decrypt: key=" + key;
|
||||
if (this.failOnError) {
|
||||
throw new IllegalStateException(message, e);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.warn(message, e);
|
||||
}
|
||||
else {
|
||||
logger.warn(message);
|
||||
}
|
||||
if (this.failOnError) {
|
||||
throw new IllegalStateException(message, e);
|
||||
}
|
||||
// Set value to empty to avoid making a password out of the
|
||||
// cipher text
|
||||
value = "";
|
||||
|
||||
Reference in New Issue
Block a user