about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore/build.cc')
-rw-r--r--third_party/nix/src/libstore/build.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/third_party/nix/src/libstore/build.cc b/third_party/nix/src/libstore/build.cc
index 6aad99b37a40..a9d40991d30d 100644
--- a/third_party/nix/src/libstore/build.cc
+++ b/third_party/nix/src/libstore/build.cc
@@ -13,6 +13,7 @@
 #include <string>
 #include <thread>
 
+#include <absl/status/status.h>
 #include <absl/strings/ascii.h>
 #include <absl/strings/numbers.h>
 #include <absl/strings/str_cat.h>
@@ -4686,7 +4687,8 @@ static void primeCache(Store& store, const PathSet& paths) {
   }
 }
 
-void LocalStore::buildPaths(const PathSet& drvPaths, BuildMode buildMode) {
+absl::Status LocalStore::buildPaths(const PathSet& drvPaths,
+                                    BuildMode buildMode) {
   Worker worker(*this);
 
   primeCache(*this, drvPaths);
@@ -4717,8 +4719,12 @@ void LocalStore::buildPaths(const PathSet& drvPaths, BuildMode buildMode) {
   }
 
   if (!failed.empty()) {
-    throw Error(worker.exitStatus(), "build of %s failed", showPaths(failed));
+    return absl::Status(
+        absl::StatusCode::kInternal,
+        absl::StrFormat("build of %s failed (exit code %d)", showPaths(failed),
+                        worker.exitStatus()));
   }
+  return absl::OkStatus();
 }
 
 BuildResult LocalStore::buildDerivation(const Path& drvPath,