From 0effeee5372c3c4f802e64c66022d6296790a3b4 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 30 Jan 2019 20:56:40 -0500 Subject: [PATCH] file-cache: use the right exception type for parse error ``` error: [json.exception.parse_error.101] parse error at 195: syntax error - invalid string: ill-formed UTF-8 byte; last read: '"bokml'; expected string literal ``` This is most probably caused by the upgrade in nixos-org-configurations/1b74e019b166d37a1510a99aeea86a0fa656854a that, in turn, caused nlohmann_json to go from 2.1.0 -> 3.2.0 I haven't found concrete evidence in the changelog as to a change changing the exception type. Though, the timing for failures matches with this update. Furthermore, once this fix is applied, launching the update locally works fine. --- file-cache.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file-cache.hh b/file-cache.hh index e589d88..8b1dfde 100644 --- a/file-cache.hh +++ b/file-cache.hh @@ -140,7 +140,7 @@ public: throw Error("NAR index for ā€˜%sā€™ has an unsupported version", storePath); recurse("", ls.at("root")); - } catch (std::invalid_argument & e) { + } catch (json::parse_error & e) { // FIXME: some filenames have non-UTF8 characters in them, // which is not supported by nlohmann::json. So we have to // skip the entire package.