Skip to content

Commit b12fb47

Browse files
Make sure Connection.Dispose doesn't throw exceptions
Per discussion in #133.
1 parent 8d10ee2 commit b12fb47

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,17 +1115,13 @@ public void HandleConnectionUnblocked()
11151115
void IDisposable.Dispose()
11161116
{
11171117
MaybeStopHeartbeatTimers();
1118-
Abort();
1119-
if (ShutdownReport.Count > 0)
1118+
try
11201119
{
1121-
foreach (ShutdownReportEntry entry in ShutdownReport)
1122-
{
1123-
if (entry.Exception != null)
1124-
{
1125-
throw entry.Exception;
1126-
}
1127-
}
1128-
throw new OperationInterruptedException(null);
1120+
Abort();
1121+
}
1122+
catch (OperationInterruptedException ignored)
1123+
{
1124+
// ignored, see rabbitmq/rabbitmq-dotnet-client#133
11291125
}
11301126
}
11311127

0 commit comments

Comments
 (0)