1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 23:51:47 +02:00

appending to hints; remove _printError

This commit is contained in:
Ben Burdette 2020-05-04 16:19:57 -06:00
parent f30de61578
commit 7ffb5efdbc
4 changed files with 18 additions and 9 deletions

View file

@ -488,14 +488,18 @@ void handleDiffHook(
auto diffRes = runProgram(diffHookOptions);
if (!statusOk(diffRes.first))
throw ExecError(diffRes.first, "diff-hook program '%1%' %2%", diffHook, statusToString(diffRes.first));
throw ExecError(diffRes.first,
"diff-hook program '%1%' %2%",
diffHook,
statusToString(diffRes.first));
if (diffRes.second != "")
printError(chomp(diffRes.second));
} catch (Error & error) {
// logError(error.info())
// TODO append message onto errorinfo...
_printError("diff hook execution failed: %s", error.what());
ErrorInfo ei = error.info();
string prevhint = (error.info().hint.has_value() ? error.info().hint->str() : "");
ei.hint = std::optional(hintfmt("diff hook execution failed: %s", prevhint));
logError(ei);
}
}
}