mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-09-03 06:01:40 +00:00
wip
This commit is contained in:
parent
2c1d58e3f6
commit
bfaea941c7
@ -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
|
||||||
|
@ -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 };
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ namespace CryptoExchange.Net.Sockets
|
|||||||
|
|
||||||
CurrentResponses++;
|
CurrentResponses++;
|
||||||
if (CurrentResponses == RequiredResponses)
|
if (CurrentResponses == RequiredResponses)
|
||||||
Response = message.Data;
|
Response = message.Data;
|
||||||
|
|
||||||
if (Result?.Success != false)
|
if (Result?.Success != false)
|
||||||
// If an error result is already set don't override that
|
// If an error result is already set don't override that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user