From fa59221ed4c2777097b0fd1a38c6839d60680499 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 04 Dec 2009 11:12:28 +0000
Subject: [PATCH] Merge Bo's most recent changes.

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

diff --git a/opendj-sdk/sdk/src/org/opends/sdk/ErrorResultException.java b/opendj-sdk/sdk/src/org/opends/sdk/ErrorResultException.java
index 5a4d7dc..9eee0d5 100644
--- a/opendj-sdk/sdk/src/org/opends/sdk/ErrorResultException.java
+++ b/opendj-sdk/sdk/src/org/opends/sdk/ErrorResultException.java
@@ -70,6 +70,24 @@
 
     // 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)
+    {
+      return new ConnectionException(result);
+    }
+
+    if(result.getResultCode() == ResultCode.CLIENT_SIDE_TIMEOUT)
+    {
+      return new OperationTimeoutException(result);
+    }
+
+    if(result.getResultCode() == ResultCode.CLIENT_SIDE_USER_CANCELLED)
+    {
+      return new CancelledException(result);
+    }
+
     return new ErrorResultException(result);
   }
 

--
Gitblit v1.10.0