IAlpacaStreamingClient Exception thrown
See original GitHub issueHi Guys,
Just want to give a headsup about a exception that was invoked by IAlpacaStreamingClient.OnError. This happend when I received a ITradingUpdate about a StopLossOrder I had on.
Here is the received Exception:
ERROR 21/01/2021 16:46:04,050 TradingAlgo.TradingService.Alpaca.AlpacaTradingService ==> [7] [InitiateStream]: Alpaca TradingStream threw an Exception: Error setting value to 'TimestampUtc' on 'Alpaca.Markets.JsonTradeUpdate'.
Newtonsoft.Json.JsonSerializationException: Error setting value to 'TimestampUtc' on 'Alpaca.Markets.JsonTradeUpdate'. ---> System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.
bij SetTimestampUtc(Object , Object )
bij Newtonsoft.Json.Serialization.DynamicValueProvider.SetValue(Object target, Object value)
--- Einde van intern uitzonderingsstackpad ---
bij Newtonsoft.Json.Serialization.DynamicValueProvider.SetValue(Object target, Object value)
bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
bij Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
bij Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
bij Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
bij Newtonsoft.Json.Linq.JToken.ToObject[T]()
bij Alpaca.Markets.ActionExtensions.DeserializeAndInvoke[TApi,TJson](Action`1 eventHandler, JToken eventArg)
bij Alpaca.Markets.AlpacaStreamingClient.handleTradeUpdate(JToken token)
bij Alpaca.Markets.StreamingClientBase`1.<>c__DisplayClass24_0`1.<HandleMessage>b__0()
bij Alpaca.Markets.SynchronizationQueue.processingTask()
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Catching exceptions thrown by the FileSystemWatcher ...
I am trying to figure out a way to catch exceptions thrown by FileSystemWatcher these seem to happen randomly as I have noticed...
Read more >Handle errors in ASP.NET Core
Exception -handling code. Code in exception handling pages can also throw exceptions. Production error pages should be tested thoroughly and take ...
Read more >MetadataFileReferenceResolver, Microsoft.CodeAnalysis C# ...
<summary> /// Resolves metadata references stored in command line arguments and reports errors for those that can't be resolved.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve not encountered the issue since I updated and made 50+ trades since. Seems to work great.
@OlegRa Thanks for the quick fix! Just updated to 4.0.2 and updated my code with null handeling. Will test in de coming week and let you know.
Nice work on the SDK by the way, it’s really straight forward to use!