Commit cb5e6812 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Better handling of exceptions.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10580 b35dd754-fafc-0310-a699-88a17e54d16e
parent 2d1795bb
...@@ -71,7 +71,8 @@ public class ClearspaceSaslServer implements SaslServer { ...@@ -71,7 +71,8 @@ public class ClearspaceSaslServer implements SaslServer {
try { try {
responseStr = StringUtils.encodeBase64(responseStr); responseStr = StringUtils.encodeBase64(responseStr);
Element resultElement = csManager.executeRequest(GET, "groupChatAuthService/isAuthTokenValid/" + responseStr); Element resultElement =
csManager.executeRequest(GET, "groupChatAuthService/isAuthTokenValid/" + responseStr);
if ("true".equals(WSUtils.getReturn(resultElement))) { if ("true".equals(WSUtils.getReturn(resultElement))) {
completed = true; completed = true;
} }
...@@ -79,8 +80,11 @@ public class ClearspaceSaslServer implements SaslServer { ...@@ -79,8 +80,11 @@ public class ClearspaceSaslServer implements SaslServer {
// Failed to authenticate the user so throw an error so SASL failure is returned // Failed to authenticate the user so throw an error so SASL failure is returned
throw new SaslException("SASL CLEARSPACE: user not authorized: " + jid); throw new SaslException("SASL CLEARSPACE: user not authorized: " + jid);
} }
} catch (SaslException e) {
// rethrow exception
throw e;
} catch (Exception e) { } catch (Exception e) {
Log.error("Failed communicating with Clearspace" , e); Log.error("Failed communicating with Clearspace", e);
throw new SaslException("SASL CLEARSPACE: user not authorized due to an error: " + jid); throw new SaslException("SASL CLEARSPACE: user not authorized due to an error: " + jid);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment