Skip to content

Commit 31a8875

Browse files
committed
merge bug25092 into default
2 parents 0637f6c + 19c2146 commit 31a8875

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ public virtual IConnection CreateConnection(int maxRedirects)
314314
if (conn != null) {
315315
return conn;
316316
}
317-
throw new BrokerUnreachableException(connectionAttempts, connectionErrors);
317+
Exception Inner = connectionErrors[Endpoint] as Exception;
318+
throw new BrokerUnreachableException(connectionAttempts, connectionErrors, Inner);
318319
}
319320

320321
///<summary>Create a connection to the specified endpoint

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ public class BrokerUnreachableException: IOException
7474

7575
///<summary>Construct a BrokerUnreachableException. Expects
7676
///maps as per the description of the ConnectionAttempts and
77-
///ConnectionErrors properties.</summary>
77+
///ConnectionErrors properties. The inner exception is associated
78+
///with only one connection attempt.</summary>
7879
public BrokerUnreachableException(IDictionary connectionAttempts,
79-
IDictionary connectionErrors)
80-
: base("None of the specified endpoints were reachable")
80+
IDictionary connectionErrors,
81+
Exception Inner)
82+
: base("None of the specified endpoints were reachable", Inner)
8183
{
8284
m_connectionAttempts = connectionAttempts;
8385
m_connectionErrors = connectionErrors;

0 commit comments

Comments
 (0)