1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-09-03 06:01:40 +00:00
This commit is contained in:
Jkorf 2025-08-13 16:33:15 +02:00
parent 2c1d58e3f6
commit bfaea941c7
4 changed files with 12 additions and 12 deletions

View File

@ -159,7 +159,7 @@ namespace CryptoExchange.Net.Objects
/// <summary> /// <summary>
/// Default error info /// Default error info
/// </summary> /// </summary>
protected static readonly ErrorInfo _errorInfo = new ErrorInfo(ErrorType.NetworkError, false, "Failed to complete the request to the server due to a network error"); protected static readonly ErrorInfo _errorInfo = new ErrorInfo(ErrorType.NetworkError, true, "Failed to complete the request to the server due to a network error");
/// <summary> /// <summary>
/// ctor /// ctor

View File

@ -44,12 +44,12 @@ namespace CryptoExchange.Net.Objects.Errors
/// </summary> /// </summary>
public ErrorInfo GetErrorInfo(string code, string? message) public ErrorInfo GetErrorInfo(string code, string? message)
{ {
message = message ?? "-"; message = message ?? code ?? "-";
if (_directMapping.TryGetValue(code, out var info)) if (_directMapping.TryGetValue(code!, out var info))
return info with { Message = message }; return info with { Message = message };
if (_evaluators.TryGetValue(code, out var eva)) if (_evaluators.TryGetValue(code!, out var eva))
return eva.ErrorTypeEvaluator.Invoke(code, message) with { Message = message }; return eva.ErrorTypeEvaluator.Invoke(code!, message) with { Message = message };
return ErrorInfo.Unknown with { Message = message }; return ErrorInfo.Unknown with { Message = message };
} }

View File

@ -141,14 +141,10 @@ namespace CryptoExchange.Net.Objects.Errors
/// </summary> /// </summary>
SymbolNotTrading, SymbolNotTrading,
/// <summary> /// <summary>
/// Order rejected due to order type or time in force restrictions /// Order rejected due to order configuration such as order type or time in force restrictions
/// </summary> /// </summary>
OrderConfigurationRejected, OrderConfigurationRejected,
/// <summary> /// <summary>
/// Order type not allowed
/// </summary>
OrderTypeInvalid,
/// <summary>
/// There is no open position /// There is no open position
/// </summary> /// </summary>
NoPosition, NoPosition,
@ -159,7 +155,11 @@ namespace CryptoExchange.Net.Objects.Errors
/// <summary> /// <summary>
/// The target object is not in the correct state for an operation /// The target object is not in the correct state for an operation
/// </summary> /// </summary>
TargetIncorrectState TargetIncorrectState,
/// <summary>
/// Risk management error
/// </summary>
RiskError
#endregion #endregion
} }