about summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/readTree/default.nix7
1 files changed, 3 insertions, 4 deletions
diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix
index 7c48d177fb..f433b27360 100644
--- a/nix/readTree/default.nix
+++ b/nix/readTree/default.nix
@@ -66,10 +66,9 @@ let
                      else import path;
       pathType = builtins.typeOf importedFile;
       imported =
-        assert assertMsg
-          (pathType == "lambda")
-          "readTree: trying to import ${toString path}, but it’s a ${pathType}, you need to make it a function like { depot, pkgs, ... }";
-        importedFile (filter (argsWithPath args parts) parts);
+        if pathType != "lambda"
+        then builtins.throw "readTree: trying to import ${toString path}, but it’s a ${pathType}, you need to make it a function like { depot, pkgs, ... }"
+        else importedFile (filter (argsWithPath args parts) parts);
     in if (isAttrs imported)
       then imported // (marker parts)
       else imported;