Class ConnectionRefusalExtensions
- Namespace
- ATAS.DataFeedsCore
- Assembly
- ATAS.DataFeedsCore.dll
Helpers that find a ConnectionRefusedException in a connection error.
<p>Added in ATAS 8.0.15.</p>
public static class ConnectionRefusalExtensions
- Inheritance
-
objectConnectionRefusalExtensions
Methods
FindConnectionRefusal(Exception?)
The ConnectionRefusedException itself or the one the error wraps, so a message shown to the user can come from the refusal rather than from the wrapper. Null when there is none.
public static ConnectionRefusedException? FindConnectionRefusal(this Exception? error)
Parameters
errorException
Returns
IsConnectionRefusal(Exception?)
Checks whether the error is or wraps a ConnectionRefusedException, also inside an System.AggregateException.
public static bool IsConnectionRefusal(this Exception? error)
Parameters
errorExceptionThe error; may be null.
Returns
- bool
true when a refusal is found.
TryGetConnectionRefusal(Exception?, out ConnectionRefusalReason)
Finds the ConnectionRefusedException in the error or in its inner exceptions (a connect failure is usually rethrown through a task and may arrive wrapped).
public static bool TryGetConnectionRefusal(this Exception? error, out ConnectionRefusalReason reason)
Parameters
errorExceptionreasonConnectionRefusalReason
Returns
- bool