@@ -48,61 +48,11 @@ namespace RabbitMQ.Client.Exceptions {
48
48
49
49
///<summary>Thrown when no connection could be opened during a
50
50
///ConnectionFactory.CreateConnection attempt.</summary>
51
- ///<remarks>
52
- /// CreateConnection (optionally) handles redirections, so even a
53
- /// single-endpoint connection attempt may end up attempting to
54
- /// connect to multiple TCP endpoints. This exception contains
55
- /// information on how many times each endpoint was tried, and the
56
- /// outcome of the most recent attempt against each endpoint. See
57
- /// the ConnectionAttempts and ConnectionErrors properties.
58
- ///</remarks>
59
51
public class BrokerUnreachableException : IOException
60
52
{
61
- private IDictionary < AmqpTcpEndpoint , int > m_connectionAttempts ;
62
- private IDictionary < AmqpTcpEndpoint , Exception > m_connectionErrors ;
63
-
64
- ///<summary>A map from AmqpTcpEndpoint to int, counting the
65
- ///number of attempts that were made against each
66
- ///endpoint.</summary>
67
- public IDictionary < AmqpTcpEndpoint , int > ConnectionAttempts { get { return m_connectionAttempts ; } }
68
-
69
- ///<summary>A map from AmqpTcpEndpoint to Exception, recording
70
- ///the outcome of the most recent connection attempt against
71
- ///each endpoint.</summary>
72
- public IDictionary < AmqpTcpEndpoint , Exception > ConnectionErrors { get { return m_connectionErrors ; } }
73
-
74
- ///<summary>same as ConnectionErrors property</summary>
75
- public override IDictionary Data { get { return new Dictionary < AmqpTcpEndpoint , Exception > ( m_connectionErrors ) ; } }
76
-
77
- ///<summary>Construct a BrokerUnreachableException. Expects
78
- ///maps as per the description of the ConnectionAttempts and
79
- ///ConnectionErrors properties. The inner exception is associated
53
+ ///<summary>Construct a BrokerUnreachableException. The inner exception is associated
80
54
///with only one connection attempt.</summary>
81
- public BrokerUnreachableException ( IDictionary < AmqpTcpEndpoint , int > connectionAttempts ,
82
- IDictionary < AmqpTcpEndpoint , Exception > connectionErrors ,
83
- Exception Inner )
84
- : base ( "None of the specified endpoints were reachable" , Inner )
85
- {
86
- m_connectionAttempts = connectionAttempts ;
87
- m_connectionErrors = connectionErrors ;
88
- }
89
-
90
- ///<summary>Provide a full description of the various
91
- ///connection attempts that were made, as well as the usual
92
- ///Exception stack trace.</summary>
93
- public override string ToString ( ) {
94
- StringBuilder sb = new StringBuilder ( base . Message ) ;
95
- sb . Append ( "\n Endpoints attempted:\n " ) ;
96
- foreach ( KeyValuePair < AmqpTcpEndpoint , int > entry in m_connectionAttempts ) {
97
- sb . Append ( "------------------------------------------------\n " ) ;
98
- sb . Append ( "endpoint=" ) . Append ( entry . Key ) ;
99
- sb . Append ( ", attempts=" ) . Append ( entry . Value ) . Append ( "\n " ) ;
100
- sb . Append ( m_connectionErrors [ entry . Key ] as Exception ) ;
101
- }
102
- sb . Append ( "\n ================================================\n " ) ;
103
- sb . Append ( "Stack trace:\n " ) ;
104
- sb . Append ( base . StackTrace ) ;
105
- return sb . ToString ( ) ;
106
- }
55
+ public BrokerUnreachableException ( Exception Inner )
56
+ : base ( "None of the specified endpoints were reachable" , Inner ) { }
107
57
}
108
58
}
0 commit comments