diff options
| author | Endi S. Dewata <edewata@redhat.com> | 2016-07-20 00:38:41 +0200 |
|---|---|---|
| committer | Endi S. Dewata <edewata@redhat.com> | 2016-07-20 01:00:49 +0200 |
| commit | eddbcedba312258cd4105f0353313c1423084593 (patch) | |
| tree | f9718fb1caf16c68d3030521bb97c9569aea6d42 /base/server/cms/src | |
| parent | 28176087a94f74b451c2dbf3c59b4d13a20014c6 (diff) | |
Fixed error handling in SystemConfigService.
To help troubleshooting the SystemConfigService has been modified
to chain the original exception and to log stack trace into the
debug log.
https://fedorahosted.org/pki/ticket/2399
Diffstat (limited to 'base/server/cms/src')
| -rw-r--r-- | base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java index 6fc37b5ee..95afa4c6a 100644 --- a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java +++ b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java @@ -782,7 +782,7 @@ public class SystemConfigService extends PKIService implements SystemConfigResou ConfigurationUtils.populateVLVIndexes(); } } catch (Exception e) { - e.printStackTrace(); + CMS.debug(e); throw new PKIException("Error in populating database: " + e, e); } } @@ -1029,14 +1029,14 @@ public class SystemConfigService extends PKIService implements SystemConfigResou String tokenpwd = data.getTokenPassword(); ConfigurationUtils.loginToken(ctoken, tokenpwd); } catch (NotInitializedException e) { - throw new PKIException("Token is not initialized"); + throw new PKIException("Token is not initialized", e); } catch (NoSuchTokenException e) { - throw new BadRequestException("Invalid Token provided. No such token."); + throw new BadRequestException("Invalid Token provided. No such token.", e); } catch (TokenException e) { - e.printStackTrace(); - throw new PKIException("Token Exception" + e); + CMS.debug(e); + throw new PKIException("Token Exception: " + e, e); } catch (IncorrectPasswordException e) { - throw new BadRequestException("Incorrect Password provided for token."); + throw new BadRequestException("Incorrect Password provided for token.", e); } } } |
