mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
* Print a better error message when a non-derivation attribute set is
coerced to a string.
This commit is contained in:
parent
096198d11f
commit
fc691e1cbd
1 changed files with 10 additions and 3 deletions
|
@ -48,6 +48,11 @@ LocalNoInlineNoReturn(void throwEvalError(const char * s, const string & s2))
|
||||||
throw EvalError(format(s) % s2);
|
throw EvalError(format(s) % s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocalNoInlineNoReturn(void throwTypeError(const char * s))
|
||||||
|
{
|
||||||
|
throw TypeError(s);
|
||||||
|
}
|
||||||
|
|
||||||
LocalNoInlineNoReturn(void throwTypeError(const char * s, const string & s2))
|
LocalNoInlineNoReturn(void throwTypeError(const char * s, const string & s2))
|
||||||
{
|
{
|
||||||
throw TypeError(format(s) % s2);
|
throw TypeError(format(s) % s2);
|
||||||
|
@ -305,9 +310,11 @@ string coerceToString(EvalState & state, Expr e, PathSet & context,
|
||||||
}
|
}
|
||||||
|
|
||||||
ATermList es;
|
ATermList es;
|
||||||
if (matchAttrs(e, es))
|
if (matchAttrs(e, es)) {
|
||||||
return coerceToString(state, makeSelect(e, toATerm("outPath")),
|
Expr e2 = queryAttr(e, "outPath");
|
||||||
context, coerceMore, copyToStore);
|
if (!e2) throwTypeError("cannot coerce an attribute set (except a derivation) to a string");
|
||||||
|
return coerceToString(state, e2, context, coerceMore, copyToStore);
|
||||||
|
}
|
||||||
|
|
||||||
if (coerceMore) {
|
if (coerceMore) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue