mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-08-31 12:42:00 +00:00
wip
This commit is contained in:
parent
2c1d58e3f6
commit
bfaea941c7
@ -159,7 +159,7 @@ namespace CryptoExchange.Net.Objects
|
||||
/// <summary>
|
||||
/// Default error info
|
||||
/// </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>
|
||||
/// ctor
|
||||
|
@ -44,12 +44,12 @@ namespace CryptoExchange.Net.Objects.Errors
|
||||
/// </summary>
|
||||
public ErrorInfo GetErrorInfo(string code, string? message)
|
||||
{
|
||||
message = message ?? "-";
|
||||
if (_directMapping.TryGetValue(code, out var info))
|
||||
message = message ?? code ?? "-";
|
||||
if (_directMapping.TryGetValue(code!, out var info))
|
||||
return info with { Message = message };
|
||||
|
||||
if (_evaluators.TryGetValue(code, out var eva))
|
||||
return eva.ErrorTypeEvaluator.Invoke(code, message) with { Message = message };
|
||||
if (_evaluators.TryGetValue(code!, out var eva))
|
||||
return eva.ErrorTypeEvaluator.Invoke(code!, message) with { Message = message };
|
||||
|
||||
return ErrorInfo.Unknown with { Message = message };
|
||||
}
|
||||
|
@ -141,14 +141,10 @@ namespace CryptoExchange.Net.Objects.Errors
|
||||
/// </summary>
|
||||
SymbolNotTrading,
|
||||
/// <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>
|
||||
OrderConfigurationRejected,
|
||||
/// <summary>
|
||||
/// Order type not allowed
|
||||
/// </summary>
|
||||
OrderTypeInvalid,
|
||||
/// <summary>
|
||||
/// There is no open position
|
||||
/// </summary>
|
||||
NoPosition,
|
||||
@ -159,7 +155,11 @@ namespace CryptoExchange.Net.Objects.Errors
|
||||
/// <summary>
|
||||
/// The target object is not in the correct state for an operation
|
||||
/// </summary>
|
||||
TargetIncorrectState
|
||||
TargetIncorrectState,
|
||||
/// <summary>
|
||||
/// Risk management error
|
||||
/// </summary>
|
||||
RiskError
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ namespace CryptoExchange.Net.Sockets
|
||||
|
||||
CurrentResponses++;
|
||||
if (CurrentResponses == RequiredResponses)
|
||||
Response = message.Data;
|
||||
Response = message.Data;
|
||||
|
||||
if (Result?.Success != false)
|
||||
// If an error result is already set don't override that
|
||||
|
Loading…
x
Reference in New Issue
Block a user