JSON error in (old, but disabled) mod crashes game

Bugs that are actually features.
Post Reply
Jürgen Erhard
Filter Inserter
Filter Inserter
Posts: 298
Joined: Sun Jun 12, 2016 11:29 pm
Contact:

JSON error in (old, but disabled) mod crashes game

Post by Jürgen Erhard »

0.624 Error Util.cpp:57: JSON parser error in package metadata: C:/Factorio 0.13 all mods/mods/autorequesttologisticchestrequester_1.0.2.zip/info.json(8): invalid code sequence

Suggested fix: mod interface needs a big helping of robustness. In Python, I'd "just" put a big try:except: around it ;-) C++? Been ages since I last touched that.

The error in the mod is that it uses literal line breaks in a string, which is invalid JSON. But it worked in 0.13.8. Not mentioned an update to the JSON library, I guess. Which seems reasonable, sort-of. Changelogging is hard, let's play Factorio. ;-)

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: JSON error in (old, but disabled) mod crashes game

Post by daniel34 »

info.json
Image
Attachments
autorequesttologisticchestrequester_1.0.2.zip
(44.87 KiB) Downloaded 78 times
quick links: log file | graphical issues | wiki

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: JSON error in (old, but disabled) mod crashes game

Post by Klonan »

This isn't a bug, you're just doing it wrong, don't put line breaks in the json

User avatar
HanziQ
Former Staff
Former Staff
Posts: 630
Joined: Fri Mar 27, 2015 7:07 am
Contact:

Re: JSON error in (old, but disabled) mod crashes game

Post by HanziQ »

It's not valid JSON, so this is not a bug. Also putting a try/catch block to "fix" it doesn't really help with robustness, it just ignores meaningful errors.

Jürgen Erhard
Filter Inserter
Filter Inserter
Posts: 298
Joined: Sun Jun 12, 2016 11:29 pm
Contact:

Re: JSON error in (old, but disabled) mod crashes game

Post by Jürgen Erhard »

So, you consider it better to just have the game crash, completely?

I can understand and accept it getting a *way* low priority at this point. But frankly, the mod loading needs to be more robust.

Oh, for one, I didn't write this mod. For another, I put quotes around "just" for a reason... and added a smiley too, for the same reason.

Post Reply

Return to “Not a bug”