File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -381,9 +381,14 @@ void Wippersnapper_FS::CreateFileConfig() {
381
381
File32 file_cfg = wipperFatFs_v2.open (" /config.json" , FILE_READ);
382
382
if (file_cfg) {
383
383
DeserializationError error = deserializeJson (_doc_cfg, file_cfg);
384
- // if (error)
385
- // HaltFilesystem("Error unable to parse config.json on WIPPER drive!");
386
- // Remove config from the filesystem
384
+ if (error) {
385
+ // If we can't deserialize, just raise
386
+ HaltFilesystem (
387
+ " [fs] Error: Unable to deserialize config.json, is it corrupted?" );
388
+ }
389
+ // We are going to parse the in-memory object, _doc_cfg, rather
390
+ // than the file. So, let's remove the ctg file since we'll replace
391
+ // it with a new cfg file later on
387
392
file_cfg.close ();
388
393
wipperFatFs_v2.remove (" /config.json" );
389
394
flash_v2.syncBlocks ();
@@ -404,6 +409,7 @@ void Wippersnapper_FS::CreateFileConfig() {
404
409
// Build components array
405
410
_doc_cfg[" components" ].to <JsonArray>();
406
411
}
412
+
407
413
return ;
408
414
}
409
415
}
You can’t perform that action at this time.
0 commit comments