Skip to content

Commit 647ea58

Browse files
Make AlreadyClosedException message clearer
1 parent c7c3957 commit 647ea58

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-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; } }

0 commit comments

Comments
 (0)