Skip to content

Commit 00308de

Browse files
Use IDictionary<K, V> for for connectionErrors
Data has to be IDictionary for compatibility with IOException's signature.
1 parent 64beaa6 commit 00308de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace RabbitMQ.Client.Exceptions {
5959
public class BrokerUnreachableException: IOException
6060
{
6161
private IDictionary<AmqpTcpEndpoint, int> m_connectionAttempts;
62-
private Dictionary<AmqpTcpEndpoint, Exception> m_connectionErrors;
62+
private IDictionary<AmqpTcpEndpoint, Exception> m_connectionErrors;
6363

6464
///<summary>A map from AmqpTcpEndpoint to int, counting the
6565
///number of attempts that were made against each
@@ -72,14 +72,14 @@ public class BrokerUnreachableException: IOException
7272
public IDictionary<AmqpTcpEndpoint, Exception> ConnectionErrors { get { return m_connectionErrors; } }
7373

7474
///<summary>same as ConnectionErrors property</summary>
75-
public override IDictionary Data { get { return m_connectionErrors; } }
75+
public override IDictionary Data { get { return new Dictionary<AmqpTcpEndpoint, Exception>(m_connectionErrors); } }
7676

7777
///<summary>Construct a BrokerUnreachableException. Expects
7878
///maps as per the description of the ConnectionAttempts and
7979
///ConnectionErrors properties. The inner exception is associated
8080
///with only one connection attempt.</summary>
8181
public BrokerUnreachableException(IDictionary<AmqpTcpEndpoint, int> connectionAttempts,
82-
Dictionary<AmqpTcpEndpoint, Exception> connectionErrors,
82+
IDictionary<AmqpTcpEndpoint, Exception> connectionErrors,
8383
Exception Inner)
8484
: base("None of the specified endpoints were reachable", Inner)
8585
{

0 commit comments

Comments
 (0)