From f134ef63e016bf13b70bef1ec277603b8a9a6f21 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 25 Apr 2012 11:06:50 +0000
Subject: [PATCH] Fix OPENDJ-474: Remove requirement for clients to deal with InterruptedExceptions in synchronous APIs
---
opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnectionFactoryImpl.java | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnectionFactoryImpl.java b/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnectionFactoryImpl.java
index f321050..3563302 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnectionFactoryImpl.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnectionFactoryImpl.java
@@ -220,8 +220,12 @@
* {@inheritDoc}
*/
@Override
- public Connection getConnection() throws ErrorResultException, InterruptedException {
- return getConnectionAsync(null).get();
+ public Connection getConnection() throws ErrorResultException {
+ try {
+ return getConnectionAsync(null).get();
+ } catch (InterruptedException e) {
+ throw newErrorResult(ResultCode.CLIENT_SIDE_USER_CANCELLED, e);
+ }
}
/**
--
Gitblit v1.10.0