diff --git a/src/worker.cc b/src/worker.cc index a1aa293..42d4d73 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -153,6 +153,12 @@ void worker(nix::ref state, nix::Bindings &autoArgs, // Don't forget to print it into the STDERR log, this is // what's shown in the Hydra UI. fprintf(stderr, "%s\n", msg.c_str()); + } catch ( + const std::exception &e) { // FIXME: for some reason the catch block + // above, doesn't trigger on macOS (?) + auto msg = e.what(); + reply["error"] = nix::filterANSIEscapes(msg, true); + fprintf(stderr, "%s\n", msg); } if (tryWriteLine(to.get(), reply.dump()) < 0) {