nlohmann has customization points for exception throws. we can use these instead and wrap json exceptions at the source instead of playing a game of whack-a-mole with json errors all over the tree. since nlohmann needs macros set to achieve this we can no longer precompile its headers *and* must forbid including it anywhere without the proper defines or ordering of include directives will break lix with ODR violations, if we see them at all before we get another json-related bug report. a new lint will be in charge of ensuring this doesn't happen. we also re-allow direct calls to nlohmann json parsing since error handling is no longer a problem. we will keep the wrapper for more convenient error context handling though. fixes #1092 Change-Id: I54ecc14f5bec5e2177729b41c3703216e76cc6a3
9 lines
288 B
Plaintext
9 lines
288 B
Plaintext
error:
|
||
… while calling the 'toJSON' builtin
|
||
at /pwd/in.nix:1:1:
|
||
1| builtins.toJSON (builtins.substring 0 1 "𝒫")
|
||
| ^
|
||
2|
|
||
|
||
error: JSON processing error: [json.exception.type_error.316] incomplete UTF-8 string; last byte: 0xF0
|