You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using this line: data = Shared.PoloniexClient.Markets.GetChartDataAsync(CurrencyPair.Parse(market), MarketPeriod, epoch, DateTime.UtcNow).Result;
...gives me these errors:
System.AggregateException: One or more errors occurred. ---> Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.IList`1[Jojatekok.PoloniexAPI.MarketTools.MarketChartData]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'error', line 1, position 9.
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Jojatekok.PoloniexAPI.Helper.DeserializeObject[T](JsonSerializer serializer, String value) in D:\C#\libs\PoloniexApi.NET\PoloniexApi.Net-1.2.0-source\PoloniexApi.Net\Helper.cs:line 51
at Jojatekok.PoloniexAPI.ApiWebClient.GetData[T](String command, Object[] parameters) in D:\C#\libs\PoloniexApi.NET\PoloniexApi.Net-1.2.0-source\PoloniexApi.Net\General\ApiWebClient.cs:line 43
at Jojatekok.PoloniexAPI.MarketTools.Markets.GetData[T](String command, Object[] parameters) in D:\C#\libs\PoloniexApi.NET\PoloniexApi.Net-1.2.0-source\PoloniexApi.Net\MarketTools\Markets.cs:line 107
at Jojatekok.PoloniexAPI.MarketTools.Markets.GetChartData(CurrencyPair currencyPair, MarketPeriod period, DateTime startTime, DateTime endTime) in D:\C#\libs\PoloniexApi.NET\PoloniexApi.Net-1.2.0-source\PoloniexApi.Net\MarketTools\Markets.cs:line 59
at Jojatekok.PoloniexAPI.MarketTools.Markets.<>c__DisplayClass14_0.<GetChartDataAsync>b__0() in D:\C#\libs\PoloniexApi.NET\PoloniexApi.Net-1.2.0-source\PoloniexApi.Net\MarketTools\Markets.cs:line 91
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
Okay, it looks like the errors are not handled? I got it working with some debugging. The error came from these JSON contents: {"error":"Invalid currency pair."} {"error":"Please specify a valid period."}
Using this line:
data = Shared.PoloniexClient.Markets.GetChartDataAsync(CurrencyPair.Parse(market), MarketPeriod, epoch, DateTime.UtcNow).Result;
...gives me these errors:
PoloniexApi.NET version: 1.2.0.0
Newtonsoft.Json version: 6.0.0.0
Newtonsoft.MsgPack version: 1.0.0.0
The text was updated successfully, but these errors were encountered: