diff options
| author | Endi S. Dewata <edewata@redhat.com> | 2016-09-15 18:05:05 +0200 |
|---|---|---|
| committer | Endi S. Dewata <edewata@redhat.com> | 2016-09-20 02:26:48 +0200 |
| commit | 15e2524c612184116763e36d5b91128662cf8006 (patch) | |
| tree | 45d1b10dc21ef72fa739636bdbe0cffd238d7e24 /base/ca/src/com/netscape | |
| parent | b0a4981937abb1a3decad7decc0a788473464039 (diff) | |
| download | pki-15e2524c612184116763e36d5b91128662cf8006.tar.gz pki-15e2524c612184116763e36d5b91128662cf8006.tar.xz pki-15e2524c612184116763e36d5b91128662cf8006.zip | |
Troubleshooting improvements for SigningUnit.
To help troubleshooting the SigningUnit for CA and OCSP have been
modified to chain the original exceptions.
https://fedorahosted.org/pki/ticket/2463
Diffstat (limited to 'base/ca/src/com/netscape')
| -rw-r--r-- | base/ca/src/com/netscape/ca/SigningUnit.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/base/ca/src/com/netscape/ca/SigningUnit.java b/base/ca/src/com/netscape/ca/SigningUnit.java index f708e557f..ac73a472e 100644 --- a/base/ca/src/com/netscape/ca/SigningUnit.java +++ b/base/ca/src/com/netscape/ca/SigningUnit.java @@ -257,16 +257,16 @@ public final class SigningUnit implements ISigningUnit { } catch (NoSuchAlgorithmException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_CA_SIGNING_ALG_NOT_SUPPORTED", algname, e.toString())); throw new ECAException( - CMS.getUserMessage("CMS_CA_SIGNING_ALGOR_NOT_SUPPORTED", algname)); + CMS.getUserMessage("CMS_CA_SIGNING_ALGOR_NOT_SUPPORTED", algname), e); } catch (TokenException e) { // from get signature context or from initSign log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_CA_SIGNING_ALG_NOT_SUPPORTED", algname, e.toString())); throw new ECAException( - CMS.getUserMessage("CMS_CA_SIGNING_ALGOR_NOT_SUPPORTED", algname)); + CMS.getUserMessage("CMS_CA_SIGNING_ALGOR_NOT_SUPPORTED", algname), e); } catch (InvalidKeyException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_CA_SIGNING_ALG_NOT_SUPPORTED", algname, e.toString())); throw new ECAException( - CMS.getUserMessage("CMS_CA_SIGNING_ALGOR_NOT_SUPPORTED_FOR_KEY", algname)); + CMS.getUserMessage("CMS_CA_SIGNING_ALGOR_NOT_SUPPORTED_FOR_KEY", algname), e); } } @@ -311,21 +311,21 @@ public final class SigningUnit implements ISigningUnit { } catch (NoSuchAlgorithmException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", e.toString())); throw new ECAException( - CMS.getUserMessage("CMS_CA_SIGNING_ALGOR_NOT_SUPPORTED", algname)); + CMS.getUserMessage("CMS_CA_SIGNING_ALGOR_NOT_SUPPORTED", algname), e); } catch (TokenException e) { // from get signature context or from initSign log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", e.toString())); // XXX fix this exception later. - throw new EBaseException(e.toString()); + throw new EBaseException(e); } catch (InvalidKeyException e) { // XXX fix this exception later. - throw new EBaseException(e.toString()); + throw new EBaseException(e); } catch (SignatureException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", e.toString())); CMS.debug("SigningUnit.sign: " + e.toString()); CMS.checkForAndAutoShutdown(); // XXX fix this exception later. - throw new EBaseException(e.toString()); + throw new EBaseException(e); } } @@ -351,21 +351,21 @@ public final class SigningUnit implements ISigningUnit { } catch (NoSuchAlgorithmException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", e.toString())); // XXX fix this exception later. - throw new EBaseException(e.toString()); + throw new EBaseException(e); } catch (TokenException e) { // from get signature context or from initSign log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", e.toString())); // XXX fix this exception later. - throw new EBaseException(e.toString()); + throw new EBaseException(e); } catch (InvalidKeyException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", e.toString())); // XXX fix this exception later. - throw new EBaseException(e.toString()); + throw new EBaseException(e); } catch (SignatureException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", e.toString())); CMS.checkForAndAutoShutdown(); // XXX fix this exception later. - throw new EBaseException(e.toString()); + throw new EBaseException(e); } } @@ -410,7 +410,7 @@ public final class SigningUnit implements ISigningUnit { String msg = "Invalid encoding in CA signing key."; log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", msg)); - throw new EBaseException(CMS.getUserMessage("CMS_BASE_INTERNAL_ERROR", msg)); + throw new EBaseException(CMS.getUserMessage("CMS_BASE_INTERNAL_ERROR", msg), e); } if (key.getAlgorithmId().getOID().equals(AlgorithmId.DSA_oid)) { |
