fix: catch errors for invalid derivations

This commit is contained in:
Tom Bereknyei
2023-01-02 08:06:06 +01:00
committed by Jörg Thalheim
parent 83aa85ca5b
commit 7110a1a6c7
+8 -3
View File
@@ -184,9 +184,14 @@ struct Drv {
auto localStore = state.store.dynamic_pointer_cast<LocalFSStore>();
for (auto out : drvInfo.queryOutputs(true)) {
if (out.second)
outputs[out.first] = localStore->printStorePath(*out.second);
try {
for (auto out : drvInfo.queryOutputs(true)) {
if (out.second)
outputs[out.first] =
localStore->printStorePath(*out.second);
}
} catch (const std::exception &e) {
throw EvalError("derivation must have valid outputs: %s", e.what());
}
if (myArgs.meta) {