diff options
| author | Tomas Restrepo <tomasr@apache.org> | 2007-05-10 22:25:01 +0000 |
|---|---|---|
| committer | Tomas Restrepo <tomasr@apache.org> | 2007-05-10 22:25:01 +0000 |
| commit | bb9ecb50f9b1a184e7ea59c933ceb56facd2fd3f (patch) | |
| tree | ceedfed77e541625e0460e8a6577d334ecffa43e /dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs | |
| parent | 0e528b07a48edcb69d5833d1dd90f12f70403fa3 (diff) | |
| download | qpid-python-bb9ecb50f9b1a184e7ea59c933ceb56facd2fd3f.tar.gz | |
QPID-441 Fix handling of bounced messages
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@537019 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs')
| -rw-r--r-- | dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs b/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs index 0ce8a393c9..7f88dd8219 100644 --- a/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs +++ b/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); } |
