Log exception on keystore build for custom certificate (#6394)

* Log exception on keystore build for custom certificate

* Refactor
This commit is contained in:
Nicolas Vazquez 2022-05-18 10:29:00 -03:00 committed by GitHub
parent d373f973ba
commit 006473ca19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,16 +108,12 @@ public class KeystoreManagerImpl extends ManagerBase implements KeystoreManager
try { try {
return CertificateHelper.buildAndSaveKeystore(certs, storePassword); return CertificateHelper.buildAndSaveKeystore(certs, storePassword);
} catch (KeyStoreException e) { } catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | InvalidKeySpecException | IOException e) {
s_logger.warn("Unable to build keystore for " + name + " due to KeyStoreException"); String msg = String.format("Unable to build keystore for %s due to %s", name, e.getClass().getSimpleName());
} catch (CertificateException e) { s_logger.warn(msg);
s_logger.warn("Unable to build keystore for " + name + " due to CertificateException"); if (s_logger.isDebugEnabled()) {
} catch (NoSuchAlgorithmException e) { s_logger.debug(msg, e);
s_logger.warn("Unable to build keystore for " + name + " due to NoSuchAlgorithmException"); }
} catch (InvalidKeySpecException e) {
s_logger.warn("Unable to build keystore for " + name + " due to InvalidKeySpecException");
} catch (IOException e) {
s_logger.warn("Unable to build keystore for " + name + " due to IOException");
} }
return null; return null;
} }