From 990307fb4882528986169d7b58f554f35521a030 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 11 Dec 2009 18:45:45 +0000
Subject: [PATCH] Various incremental improvements.

---
 opendj-sdk/sdk/src/org/opends/sdk/ErrorResultException.java |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/opendj-sdk/sdk/src/org/opends/sdk/ErrorResultException.java b/opendj-sdk/sdk/src/org/opends/sdk/ErrorResultException.java
index 9eee0d5..89af186 100644
--- a/opendj-sdk/sdk/src/org/opends/sdk/ErrorResultException.java
+++ b/opendj-sdk/sdk/src/org/opends/sdk/ErrorResultException.java
@@ -70,22 +70,34 @@
 
     // TODO: choose type of exception based on result code (e.g.
     // referral).
-    if(result.getResultCode() == ResultCode.CLIENT_SIDE_SERVER_DOWN ||
-        result.getResultCode() == ResultCode.CLIENT_SIDE_CONNECT_ERROR ||
-        result.getResultCode() == ResultCode.CLIENT_SIDE_DECODING_ERROR ||
-        result.getResultCode() == ResultCode.CLIENT_SIDE_ENCODING_ERROR)
+    if (result.getResultCode() == ResultCode.CLIENT_SIDE_SERVER_DOWN
+        || result.getResultCode() == ResultCode.CLIENT_SIDE_CONNECT_ERROR
+        || result.getResultCode() == ResultCode.CLIENT_SIDE_DECODING_ERROR
+        || result.getResultCode() == ResultCode.CLIENT_SIDE_ENCODING_ERROR)
     {
       return new ConnectionException(result);
     }
 
-    if(result.getResultCode() == ResultCode.CLIENT_SIDE_TIMEOUT)
+    if (result.getResultCode() == ResultCode.CLIENT_SIDE_TIMEOUT)
     {
-      return new OperationTimeoutException(result);
+      return new TimeoutResultException(result);
     }
 
-    if(result.getResultCode() == ResultCode.CLIENT_SIDE_USER_CANCELLED)
+    if (result.getResultCode() == ResultCode.CLIENT_SIDE_USER_CANCELLED
+        || result.getResultCode() == ResultCode.CANCELLED)
     {
-      return new CancelledException(result);
+      return new CancelledResultException(result);
+    }
+
+    if (result.getResultCode() == ResultCode.NO_SUCH_OBJECT
+        || result.getResultCode() == ResultCode.CLIENT_SIDE_NO_RESULTS_RETURNED)
+    {
+      return new EntryNotFoundException(result);
+    }
+
+    if (result.getResultCode() == ResultCode.CLIENT_SIDE_UNEXPECTED_RESULTS_RETURNED)
+    {
+      return new MultipleEntriesFoundException(result);
     }
 
     return new ErrorResultException(result);

--
Gitblit v1.10.0