diff --git a/CryptoExchange.Net/Clients/RestApiClient.cs b/CryptoExchange.Net/Clients/RestApiClient.cs index a17ce6f..4f85a04 100644 --- a/CryptoExchange.Net/Clients/RestApiClient.cs +++ b/CryptoExchange.Net/Clients/RestApiClient.cs @@ -470,10 +470,8 @@ namespace CryptoExchange.Net.Clients error = ParseErrorResponse((int)response.StatusCode, response.ResponseHeaders, accessor, readResult.Error?.Exception); } -#pragma warning disable CS0618 // Type or member is obsolete if (error.Code == null || error.Code == 0) error.Code = (int)response.StatusCode; -#pragma warning restore CS0618 // Type or member is obsolete return new WebCallResult(response.StatusCode, response.ResponseHeaders, sw.Elapsed, responseLength, OutputOriginalData ? accessor.GetOriginalString() : null, request.RequestId, request.Uri.ToString(), request.Content, request.Method, request.GetHeaders(), ResultDataSource.Server, default, error!); } diff --git a/CryptoExchange.Net/Objects/Error.cs b/CryptoExchange.Net/Objects/Error.cs index 493a875..99bcaa5 100644 --- a/CryptoExchange.Net/Objects/Error.cs +++ b/CryptoExchange.Net/Objects/Error.cs @@ -11,9 +11,11 @@ namespace CryptoExchange.Net.Objects private int? _code; /// - /// The error code from the server + /// The int error code the server returned; or the http status code int value if there was no error code.
+ ///
+ /// Note:
+ /// The property should be used for more generic error checking; it might contain a string error code if the server does not return an int code. ///
- [Obsolete("Use ErrorCode instead", false)] public int? Code { get