From cac9db624b611981e9d8ecf64561fe7ed7e173a6 Mon Sep 17 00:00:00 2001 From: Tomas Restrepo Date: Thu, 10 May 2007 23:02:46 +0000 Subject: Merged revisions 537015-537026 via svnmerge from https://svn.apache.org/repos/asf/incubator/qpid/branches/M2 ........ r537015 | tomasr | 2007-05-10 17:16:49 -0500 (Thu, 10 May 2007) | 1 line QPID-435: Fix HeadersExchangeTest ........ r537019 | tomasr | 2007-05-10 17:25:01 -0500 (Thu, 10 May 2007) | 1 line QPID-441 Fix handling of bounced messages ........ r537026 | tomasr | 2007-05-10 17:46:46 -0500 (Thu, 10 May 2007) | 1 line QPID-398 SSL support for .NET client ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@537031 13f79535-47bb-0310-9956-ffa450edef68 --- .../Client/Handler/ChannelCloseMethodHandler.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs') diff --git a/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs b/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs index 0ce8a393c9..7f88dd8219 100644 --- a/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs +++ b/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs @@ -44,11 +44,20 @@ namespace Qpid.Client.Handler AMQFrame frame = ChannelCloseOkBody.CreateAMQFrame(evt.ChannelId); evt.ProtocolSession.WriteFrame(frame); - // HACK + if ( errorCode != AMQConstant.REPLY_SUCCESS.Code ) { - _logger.Debug("Channel close received with errorCode " + errorCode + ", throwing exception"); - evt.ProtocolSession.AMQConnection.ExceptionReceived(new AMQChannelClosedException(errorCode, "Error: " + reason)); + _logger.Debug("Channel close received with errorCode " + errorCode + ", throwing exception"); + if ( errorCode == AMQConstant.NO_CONSUMERS.Code ) + throw new AMQNoConsumersException(reason); + if ( errorCode == AMQConstant.NO_ROUTE.Code ) + throw new AMQNoRouteException(reason); + if ( errorCode == AMQConstant.INVALID_ARGUMENT.Code ) + throw new AMQInvalidArgumentException(reason); + if ( errorCode == AMQConstant.INVALID_ROUTING_KEY.Code ) + throw new AMQInvalidRoutingKeyException(reason); + // any other + throw new AMQChannelClosedException(errorCode, "Error: " + reason); } evt.ProtocolSession.ChannelClosed(evt.ChannelId, errorCode, reason); } -- cgit v1.2.1