mirror of
https://github.com/DietrichGebert/ponytail.git
synced 2026-09-14 18:11:01 +08:00
40e50d9e03
If settings.json contained invalid JSON, JSON.parse threw a SyntaxError, which has no .code, so the catch rethrew it and crashed the script — after the mode flag and config file were already removed, leaving cleanup half-done. Handle SyntaxError explicitly: warn that the statusLine entry couldn't be removed and leave the file untouched, since invalid JSON can't be safely edited. Adds a regression test that a malformed settings.json exits 0, warns, and is left byte-for-byte intact. Closes #434 Co-authored-by: isaukywhite <50426537+isaukywhite@users.noreply.github.com>