Files
lix/doc/manual/rl-next/json-parse-errors.md
T
eldritch horrors 0d47773d76 treewide: handle JSON parse errors
or more accurately, wrap them in a nix::Error subclass so we can display
them properly without crashing, and add some error context if available.

fixes #642
fixes #753
fixes #759
fixes #769

Change-Id: I1aad0c0501fea83f9de3a1335eaa6adc20721616
2025-03-27 08:56:14 +00:00

584 B
Raw Blame History

synopsis, issues, cls, category, credits
synopsis issues cls category credits
Fix Lix crashing on invalid json
fj#642
fj#753
fj#759
fj#769
2907
Fixes
horrors

Lix no longer crashes when it receives invalid JSON. Instead it'll point to the syntax error and give some context about what happened, for example

 nix derivation add <<<"""
error:
       … while parsing a derivation from stdin

       error: failed to parse JSON: [json.exception.parse_error.101] parse error at line 2, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal