Skip to content

Commit c0cfb0a

Browse files
committed
Do not throw exceptions in Dispose
1 parent 4a8c9c6 commit c0cfb0a

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -750,21 +750,13 @@ void IDisposable.Dispose()
750750
{
751751
Abort();
752752
}
753-
finally
753+
catch(Exception)
754754
{
755-
m_models.Clear();
755+
// TODO: log
756756
}
757-
if (ShutdownReport.Count > 0)
757+
finally
758758
{
759-
foreach (ShutdownReportEntry entry in ShutdownReport)
760-
{
761-
if (entry.Exception != null)
762-
{
763-
throw entry.Exception;
764-
}
765-
}
766-
767-
throw new OperationInterruptedException(null);
759+
m_models.Clear();
768760
}
769761
}
770762

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,9 +1240,9 @@ public void HandleConnectionUnblocked()
12401240

12411241
void IDisposable.Dispose()
12421242
{
1243-
MaybeStopHeartbeatTimers();
12441243
try
12451244
{
1245+
MaybeStopHeartbeatTimers();
12461246
Abort();
12471247
}
12481248
catch (OperationInterruptedException)

0 commit comments

Comments
 (0)