❔ Error parsing infinity for json, Happens randomly.
Error: I keep getting the error parsing infinity while selecting a random string from my json array, It does this at random and I have no idea why. I have a temporary fix at line 49 but it is making the scene restart multiple times and is just not pleasant one bit
Snippet:
Full Code: https://paste.ofcode.org/QYQsqkuvYuU9JgFf8vsGGS
12 Replies
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
Error parsing Infinity value. Path '', line 1, position 2
Thats what i get
can you provide a sample of json you're parsing
Uhm, what bugs me: is there any benefit reading the json dynamically at all?
["cartman dies", "the boys bring communism to Canada", "cartman gets caught eating glass"]
not really, I just have a python backend which listens for topics from my streams chats and write it to that json
how often does that happen?
usually after 6 parses but it can happen after 2 (its basically random)
So, could it be, that the read happens while your python scripts performs a write to a file, and thus json is in a corrupted state and can't be deserialized?
nope happens even when the backend isnt running
Okay, I'm not guessing what it is, but I'd probably put a try catch block here, with a logger call on catch, dumping the contents of File.ReadAllText to log
I doubt there's a problem with deserializer, more likely there's some problem with file handling
alright i will give it a go, will update you
so something like
var x = read;
try { deserialize } catch { log(exception); log(x); }
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.