Merge remote-tracking branch 'origin/master' into flake

This commit is contained in:
Eelco Dolstra
2020-03-04 15:28:23 +01:00
10 changed files with 133 additions and 17 deletions

View File

@ -147,9 +147,10 @@ static void worker(
nlohmann::json reply;
try {
auto v = findAlongAttrPath(state, attrPath, autoArgs, *vRoot).first;
auto vTmp = findAlongAttrPath(state, attrPath, autoArgs, *vRoot).first;
state.forceValue(*v);
auto v = state.allocValue();
state.autoCallFunction(autoArgs, *vTmp, *v);
if (auto drv = getDerivation(state, *v, false)) {
@ -231,6 +232,11 @@ static void worker(
reply["attrs"] = std::move(attrs);
}
else if (v->type == tNull)
;
else throw TypeError("attribute '%s' is %s, which is not supported", attrPath, showType(*v));
} catch (EvalError & e) {
reply["error"] = filterANSIEscapes(e.msg(), true);
}