Skip to content

Commit a30ecc6

Browse files
author
Alexandru Scvortov
committed
correct exception for WaitForConfirms
Same reasoning as for the Java client: if the underlying channel closed, we throw and AlreadyClosedException; if we received a nack, we die with an IOException.
1 parent 8479b4e commit a30ecc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ public bool WaitForConfirms()
938938
lock (m_unconfirmedSet.SyncRoot) {
939939
while (true) {
940940
if (CloseReason != null)
941-
throw new OperationInterruptedException(CloseReason);
941+
throw new AlreadyClosedException(CloseReason);
942942

943943
if (m_unconfirmedSet.Count == 0) {
944944
bool aux = m_onlyAcksReceived;
@@ -957,7 +957,7 @@ public void WaitForConfirmsOrDie()
957957
CommonFraming.Constants.ReplySuccess,
958958
"Nacks Received", new IOException("nack received")),
959959
false);
960-
throw new OperationInterruptedException(CloseReason);
960+
throw new IOException("Nacks Received");
961961
}
962962
}
963963

0 commit comments

Comments
 (0)