Skip to content

Commit dfa415d

Browse files
author
Matthew Sackman
committed
merging bug 22100 into default
2 parents f9db6e3 + 40c5c03 commit dfa415d

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ public class BrokerUnreachableException: IOException
8585
///each endpoint.</summary>
8686
public IDictionary ConnectionErrors { get { return m_connectionErrors; } }
8787

88+
///<summary>same as ConnectionErrors property</summary>
89+
public override IDictionary Data { get { return m_connectionErrors; } }
90+
8891
///<summary>Construct a BrokerUnreachableException. Expects
8992
///maps as per the description of the ConnectionAttempts and
9093
///ConnectionErrors properties.</summary>
@@ -103,19 +106,12 @@ public override string ToString() {
103106
StringBuilder sb = new StringBuilder(base.Message);
104107
sb.Append("\nEndpoints attempted:\n");
105108
foreach (DictionaryEntry entry in m_connectionAttempts) {
106-
sb.Append(" endpoint=");
107-
sb.Append(entry.Key);
108-
sb.Append(", attempts=");
109-
sb.Append(entry.Value);
110-
sb.Append(", outcome=");
111-
Exception e = m_connectionErrors[entry.Key] as Exception;
112-
if (e == null) {
113-
sb.Append("(null)");
114-
} else {
115-
sb.Append(e.Message);
116-
}
117-
sb.Append("\n");
109+
sb.Append("------------------------------------------------\n");
110+
sb.Append("endpoint=").Append(entry.Key);
111+
sb.Append(", attempts=").Append(entry.Value).Append("\n");
112+
sb.Append(m_connectionErrors[entry.Key] as Exception);
118113
}
114+
sb.Append("\n================================================\n");
119115
sb.Append("Stack trace:\n");
120116
sb.Append(base.StackTrace);
121117
return sb.ToString();

0 commit comments

Comments
 (0)