[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Pki-devel] [PATCH] 816 Added exception wrapper for invalid LDAP attribute syntax.



The LDAPExceptionConverter has been modified to wrap LDAPException
for invalid attribute syntax with BadRequestException.

https://fedorahosted.org/pki/ticket/833

Pushed to master (10.4) under one-liner/trivial rule.

--
Endi S. Dewata
>From 41de99bf80d3e9689e0ceb1baf4a2b701ea77168 Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata redhat com>
Date: Fri, 12 Aug 2016 23:06:24 +0200
Subject: [PATCH] Added exception wrapper for invalid LDAP attribute syntax.

The LDAPExceptionConverter has been modified to wrap LDAPException
for invalid attribute syntax with BadRequestException.

https://fedorahosted.org/pki/ticket/833
---
 .../src/com/netscape/certsrv/ldap/LDAPExceptionConverter.java       | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/base/common/src/com/netscape/certsrv/ldap/LDAPExceptionConverter.java b/base/common/src/com/netscape/certsrv/ldap/LDAPExceptionConverter.java
index 88b126351d54551b3481ee6f9742db033aa29557..51a1109f2b3790841e24ba853be34aceb90f4bee 100644
--- a/base/common/src/com/netscape/certsrv/ldap/LDAPExceptionConverter.java
+++ b/base/common/src/com/netscape/certsrv/ldap/LDAPExceptionConverter.java
@@ -17,13 +17,13 @@
 // --- END COPYRIGHT BLOCK ---
 package com.netscape.certsrv.ldap;
 
-import netscape.ldap.LDAPException;
-
 import com.netscape.certsrv.base.BadRequestException;
 import com.netscape.certsrv.base.ConflictingOperationException;
 import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.base.ResourceNotFoundException;
 
+import netscape.ldap.LDAPException;
+
 /**
  * @author Endi S. Dewata
  */
@@ -39,6 +39,8 @@ public class LDAPExceptionConverter {
             return new ResourceNotFoundException("No such attribute.", e);
         case LDAPException.INVALID_DN_SYNTAX:
             return new BadRequestException("Invalid DN syntax.", e);
+        case LDAPException.INVALID_ATTRIBUTE_SYNTAX:
+            return new BadRequestException("Invalid attribute syntax.", e);
         case LDAPException.ENTRY_ALREADY_EXISTS:
             return new ConflictingOperationException("Entry already exists.", e);
         default:
-- 
2.5.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]