summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/apps
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-01-20 09:25:32 -0500
committerEndi S. Dewata <edewata@redhat.com>2015-01-21 15:35:37 -0500
commit802f7471d5ee65e3c4d99b528bb6d8526c277185 (patch)
tree02dd03d41e301499b0b28fbd0af948f253bac03d /base/common/src/com/netscape/certsrv/apps
parentdeb188bffd38f82396c47411381a875020ca748b (diff)
downloadpki-802f7471d5ee65e3c4d99b528bb6d8526c277185.tar.gz
pki-802f7471d5ee65e3c4d99b528bb6d8526c277185.tar.xz
pki-802f7471d5ee65e3c4d99b528bb6d8526c277185.zip
Added support for exception chains in EBaseException.
The EBaseException has been modified to provide constructors that can be used to chain the cause of the exception. This way the root cause of the exception can be traced back to help troubleshooting. Some codes have been modified to utilize the proper exception chaining as examples. https://fedorahosted.org/pki/ticket/915
Diffstat (limited to 'base/common/src/com/netscape/certsrv/apps')
-rw-r--r--base/common/src/com/netscape/certsrv/apps/CMS.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/base/common/src/com/netscape/certsrv/apps/CMS.java b/base/common/src/com/netscape/certsrv/apps/CMS.java
index 63c1a2cbd..8b4bac2c0 100644
--- a/base/common/src/com/netscape/certsrv/apps/CMS.java
+++ b/base/common/src/com/netscape/certsrv/apps/CMS.java
@@ -17,8 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.certsrv.apps;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
import java.security.cert.Certificate;
@@ -1586,21 +1584,19 @@ public final class CMS {
CMS.startup();
} catch (EBaseException e) { // catch everything here purposely
- CMS.debug("CMS:Caught EBaseException");
CMS.debug(e);
// Raidzilla Bug #57592: Always print error message to stdout.
- System.out.println(e.toString());
+ System.out.println(e);
shutdown();
throw e;
- } catch (Exception e) { // catch everything here purposely
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(bos);
- e.printStackTrace(ps);
+ } catch (Exception e) { // catch everything here purposely
+ CMS.debug(e);
System.out.println(Constants.SERVER_SHUTDOWN_MESSAGE);
- throw new EBaseException(bos.toString());
+
+ throw new EBaseException(e);
// cms.shutdown();
}
}