From 59b94ee18ac0cba5c7b261ee72550a4d3db0acb5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 5 Apr 2004 22:27:41 +0000 Subject: * When something goes wrong in the evaluation of a Nix expression, print a nice backtrace of the stack, rather than vomiting a gigantic (and useless) aterm on the screen. Example: error: while evaluating file `.../pkgs/system/test.nix': while evaluating attribute `subversion' at `.../pkgs/system/all-packages-generic.nix', line 533: while evaluating function at `.../pkgs/applications/version-management/subversion/default.nix', line 1: assertion failed at `.../pkgs/applications/version-management/subversion/default.nix', line 13 Since the Nix expression language is lazy, the trace may be misleading. The purpose is to provide a hint as to the location of the problem. --- src/nix-instantiate/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nix-instantiate/main.cc') diff --git a/src/nix-instantiate/main.cc b/src/nix-instantiate/main.cc index cc3444837cd5..5ef6bd7d1b8b 100644 --- a/src/nix-instantiate/main.cc +++ b/src/nix-instantiate/main.cc @@ -47,7 +47,7 @@ static void printNixExpr(EvalState & state, Expr e) return; } - throw badTerm("top level does not evaluate to one or more Nix expressions", e); + throw Error("expression does not evaluate to one or more derivations"); } -- cgit 1.4.1