Unable to Parse Data exception while requesting GTTs

prasad_oct12
prasad_oct12 edited August 2020 in .Net API client
Hi When I try to get GTT, it is throwing unable to parse data exception.

Below are the stack trace:
at KiteConnect.GTT..ctor(Dictionary`2 data)
at KiteConnect.Kite.GetGTTs()
at ConsoleApp1.Program.GTTS() in ..\..\Program.cs:line 119

Inner exception is :
Unable to parse data. {"exchange":"NFO","last_price":324.5,"tradingsymbol":"BANKNIFTY2082021700CE","trigger_values":[315.9,386.1]}
  • prasad_oct12
    When I debugged the KiteConnect application, I found that while constructing for one of the GTT object, for Condition property, InstrumentToken is missing in JSON data received from Kite server. So in backend some how InstrumentToken is null now for ALREADY TRIGGERED GTT. Is this something strange?
  • sujith
    Did you modify this GTT?
  • prasad_oct12
    Yes, I modified the GTT and also I was passing InstrumentToken
  • tonystark
    Hi @prasad_oct12,

    The exception has been fixed in version 3.0.6 of library. Could you update library from Nuget and verify if it works?

    For now InstrumentToken will be 0 for the GTTs that caused this exception. This will be fixed shortly. Thanks for notifying the bug.
  • prasad_oct12
    Hi @tonystark,

    Since that day it was quite urgent, actually I downloaded the git code and modified same(meaning if intrumenttoken is null, made that to 0) and it worked for me!!.

    After that day, didn't noticed the behavior!

    Just a suggestion, rather making instrumenttoken to 0, can't you make the system to throw exception if the instrumenttoken is 0. Since this may lead to another issue, so if it is null can you throw exception?
  • tonystark
    Missing that field is the actual issue which we are currently working to fix. It shouldn't have happened in the first place. Setting token to 0 is just a workaround and will be reverted back to the original logic once the backend issue is resolved.

    Throwing a specific exception for that is also a possible workaround but the idea was to not break the library because of this.
  • prasad_oct12
    @tonystark , Exactly!, looking forward for the actual fix :smile:
    You can close this discussion!
This discussion has been closed.