From c700093f4294bb1bcda42f3fc1982dcc57dc44da Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Fri, 13 Aug 2010 16:19:28 +0000 Subject: QPID-2657: Correct handling of sync on 0-10 client session for exceptions AMQSession_0_10 is modified to contain a pair of get/set methods for the current exception, using the set method to post the exception to the listener. The sync method will now throw an exception if one has occurred and all other methods that used to call sync()/getCurrentException() can just call sync(0 and get the expected behaviour. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@985262 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/server/transport/ServerConnection.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'java/broker/src') diff --git a/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnection.java b/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnection.java index e71782b116..8c7b374791 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnection.java +++ b/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnection.java @@ -105,11 +105,19 @@ public class ServerConnection extends Connection implements AMQConnectionModel public void closeSession(AMQSessionModel session, AMQConstant cause, String message) throws AMQException { ExecutionException ex = new ExecutionException(); - ex.setErrorCode(ExecutionErrorCode.get(cause.getCode())); + ExecutionErrorCode code = ExecutionErrorCode.INTERNAL_ERROR; + try + { + code = ExecutionErrorCode.get(cause.getCode()); + } + catch (IllegalArgumentException iae) + { + // Ignore, already set to INTERNAL_ERROR + } + ex.setErrorCode(code); ex.setDescription(message); ((ServerSession)session).invoke(ex); ((ServerSession)session).close(); } - } -- cgit v1.2.1