Make decryption code fail-fast AFTER logging the error.

This commit is contained in:
rhanton
2018-08-20 11:09:14 -07:00
parent 75e504765f
commit 4fe7bcabf0

View File

@@ -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 = "";