diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-02-04 03:09:45 +0100 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-02-05 16:06:19 +0100 |
commit | 4c1f6b632fe5493ba3bfe106257192d3fc088f15 (patch) | |
tree | 419e418a17be085532db6eea6d8c4b7fd09c3e0a /base/server/cmscore/src/com/netscape/cmscore/dbs | |
parent | b1adc600c4ab63f6069d165b42880ae4f7cc40fc (diff) | |
download | pki-4c1f6b632fe5493ba3bfe106257192d3fc088f15.tar.gz pki-4c1f6b632fe5493ba3bfe106257192d3fc088f15.tar.xz pki-4c1f6b632fe5493ba3bfe106257192d3fc088f15.zip |
Fixed LDAP error handling in TokenService.
The DBSSession has been modified to attach the LDAPException
to the EDBException. The TokenService will catch the EDBException
and obtain the orignal LDAPException. This way the TokenService
can obtain the LDAP error code and throw the proper exception
the client.
https://fedorahosted.org/pki/ticket/1646
Diffstat (limited to 'base/server/cmscore/src/com/netscape/cmscore/dbs')
-rw-r--r-- | base/server/cmscore/src/com/netscape/cmscore/dbs/DBSSession.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/base/server/cmscore/src/com/netscape/cmscore/dbs/DBSSession.java b/base/server/cmscore/src/com/netscape/cmscore/dbs/DBSSession.java index ad1be6602..2bfd5f2da 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/dbs/DBSSession.java +++ b/base/server/cmscore/src/com/netscape/cmscore/dbs/DBSSession.java @@ -19,18 +19,6 @@ package com.netscape.cmscore.dbs; import java.util.Enumeration; -import netscape.ldap.LDAPAttribute; -import netscape.ldap.LDAPAttributeSet; -import netscape.ldap.LDAPConnection; -import netscape.ldap.LDAPEntry; -import netscape.ldap.LDAPException; -import netscape.ldap.LDAPModification; -import netscape.ldap.LDAPModificationSet; -import netscape.ldap.LDAPSearchConstraints; -import netscape.ldap.LDAPSearchResults; -import netscape.ldap.LDAPv2; -import netscape.ldap.controls.LDAPPersistSearchControl; - import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.ISubsystem; @@ -46,6 +34,18 @@ import com.netscape.certsrv.dbs.Modification; import com.netscape.certsrv.dbs.ModificationSet; import com.netscape.certsrv.logging.ILogger; +import netscape.ldap.LDAPAttribute; +import netscape.ldap.LDAPAttributeSet; +import netscape.ldap.LDAPConnection; +import netscape.ldap.LDAPEntry; +import netscape.ldap.LDAPException; +import netscape.ldap.LDAPModification; +import netscape.ldap.LDAPModificationSet; +import netscape.ldap.LDAPSearchConstraints; +import netscape.ldap.LDAPSearchResults; +import netscape.ldap.LDAPv2; +import netscape.ldap.controls.LDAPPersistSearchControl; + /** * A class represents the database session. Operations * can be performed with a session. @@ -119,9 +119,9 @@ public class DBSSession implements IDBSSession { } catch (LDAPException e) { if (e.getLDAPResultCode() == LDAPException.UNAVAILABLE) throw new EDBNotAvailException( - CMS.getUserMessage("CMS_DBS_INTERNAL_DIR_UNAVAILABLE")); + CMS.getUserMessage("CMS_DBS_INTERNAL_DIR_UNAVAILABLE"), e); throw new EDBException(CMS.getUserMessage("CMS_DBS_LDAP_OP_FAILURE", - name + " " + e.toString())); + name + ": " + e.getMessage()), e); } } |