Finding it hard to reliably parse data, returns undefined error inevitably



I’m try to parse specific data from the streaming api using JSON keys to obtain the values. This works for a short period, then returns an undefined error. Is there anything I can do to get around this?