Skip to content

Commit 3d06ed3

Browse files
author
Simon MacMullen
committed
Merge bug26068
2 parents 36886bc + 8ba8773 commit 3d06ed3

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

projects/client/RabbitMQ.Client/src/client/exceptions/AlreadyClosedException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ public class AlreadyClosedException: OperationInterruptedException
4949
///<summary>Construct an instance containing the given
5050
///shutdown reason.</summary>
5151
public AlreadyClosedException(ShutdownEventArgs reason)
52-
: base(reason) { }
52+
: base(reason, "Already closed") { }
5353
}
5454
}

projects/client/RabbitMQ.Client/src/client/exceptions/OperationInterruptedException.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ public OperationInterruptedException(ShutdownEventArgs reason)
8181
m_shutdownReason = reason;
8282
}
8383

84+
///<summary>Construct an OperationInterruptedException with
85+
///the passed-in explanation and prefix, if any.</summary>
86+
public OperationInterruptedException(ShutdownEventArgs reason, String prefix)
87+
: base(reason == null ? (prefix + ": The AMQP operation was interrupted") :
88+
string.Format("{0}: The AMQP operation was interrupted: {1}",
89+
prefix, reason))
90+
{
91+
m_shutdownReason = reason;
92+
}
93+
8494
///<summary>Retrieves the explanation for the shutdown. May
8595
///return null if no explanation is available.</summary>
8696
public ShutdownEventArgs ShutdownReason { get { return m_shutdownReason; } }

projects/client/Unit/src/unit/TestExceptionMessages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public void TestAlreadyClosedExceptionMessage()
6767
} catch (AlreadyClosedException e)
6868
{
6969
Assert.That(e, Is.TypeOf(typeof(AlreadyClosedException)));
70+
Assert.IsTrue(e.Message.StartsWith("Already closed"));
7071
}
7172
}
7273
}

0 commit comments

Comments
 (0)