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
584 B
584 B
synopsis, issues, cls, category, credits
| synopsis | issues | cls | category | credits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Fix Lix crashing on invalid json |
|
|
Fixes |
|
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