From 00d3f014e729df1ccc21ee3ee07156516e34482d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 10 Dec 2023 08:55:56 +0100 Subject: [PATCH] print error if worker receives invalid command --- src/nix-eval-jobs.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nix-eval-jobs.cc b/src/nix-eval-jobs.cc index e2e78d7..27be870 100644 --- a/src/nix-eval-jobs.cc +++ b/src/nix-eval-jobs.cc @@ -366,10 +366,14 @@ static void worker(ref state, Bindings &autoArgs, AutoCloseFD &to, } auto s = fromReader.readLine(); - if (s == "exit") + if (s == "exit") { break; - if (!hasPrefix(s, "do ")) + } + if (!hasPrefix(s, "do ")) { + fprintf(stderr, "worker error: received invalid command '%s'\n", + s.data()); abort(); + } auto path = json::parse(s.substr(3)); auto attrPathS = attrPathJoin(path);