diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-07-19 15:36:15 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-07-19 15:36:15 +0000 |
commit | 4f3725b167cc0080c570a814e28c6181ef5c7f52 (patch) | |
tree | 0e3bc97c8e207cdb0de3403a0430909debe5c043 /src/libexpr/get-drvs.cc | |
parent | e10b830251af37951109113d88ddf203ae95645c (diff) |
* Better error messages (especially wrt types).
Diffstat (limited to 'src/libexpr/get-drvs.cc')
-rw-r--r-- | src/libexpr/get-drvs.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index 8e439f08b..82e34f776 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -16,7 +16,7 @@ string DrvInfo::queryOutPath(EvalState & state) const { if (outPath == "") { Expr a = attrs->get(toATerm("outPath")); - if (!a) throw Error("output path missing"); + if (!a) throw TypeError("output path missing"); (string &) outPath = evalPath(state, a); } return outPath; @@ -81,7 +81,7 @@ static bool getDerivation(EvalState & state, Expr e, a = attrs->get(toATerm("name")); /* !!! We really would like to have a decent back trace here. */ - if (!a) throw Error("derivation name missing"); + if (!a) throw TypeError("derivation name missing"); drv.name = evalString(state, a); a = attrs->get(toATerm("system")); @@ -123,7 +123,7 @@ static void getDerivations(EvalState & state, Expr e, for (ATermIterator i(formals); i; ++i) { Expr name, def; if (matchNoDefFormal(*i, name)) - throw Error(format("expression evaluates to a function with no-default arguments (`%1%')") + throw TypeError(format("cannot auto-call a function that has an argument without a default value (`%1%')") % aterm2String(name)); else if (!matchDefFormal(*i, name, def)) abort(); /* can't happen */ @@ -224,7 +224,7 @@ static void getDerivations(EvalState & state, Expr e, return; } - throw Error("expression does not evaluate to a derivation (or a set or list of those)"); + throw TypeError("expression does not evaluate to a derivation (or a set or list of those)"); } |