JSON error in (old, but disabled) mod crashes game
Posted: Fri Jul 15, 2016 11:58 pm
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.
Re: JSON error in (old, but disabled) mod crashes game
{
"name": "autorequesttologisticchestrequester",
"version": "1.0.2",
"title": "Auto Request to Logistic Chest Requester",
"author": "maurojunior2011",
"homepage": "",
"dependencies": ["base"],
"description": "[ENGLISH] Place the assembly machine (1,2,3) and set a construction, then build a Inserter (Anyone) [No need to be in that order],
as well as putting the requester Chest automatically prompted the ingredients that the Assembly Machine need.
[PT-BR]Coloque a Máquina de montagem (1,2,3) e defina uma contrução, depois construa um Insersor (Qualquer um) [Não precisa ser nessa ordem],
assim quanto colocar o Baú solicitador, automaticamente será solicitado os ingredientes que a Máquina de Montagem necessita."
}
Re: JSON error in (old, but disabled) mod crashes game
Posted: Mon Jul 18, 2016 11:36 am
by Klonan
This isn't a bug, you're just doing it wrong, don't put line breaks in the json
Re: JSON error in (old, but disabled) mod crashes game
Posted: Mon Jul 18, 2016 11:37 am
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.
Re: JSON error in (old, but disabled) mod crashes game
Posted: Mon Jul 18, 2016 12:55 pm
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.