mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
showTrace flag for ErrorInfo; showTrace test.
This commit is contained in:
parent
9c0e1fd4f1
commit
9ab808c926
4 changed files with 61 additions and 34 deletions
|
@ -303,6 +303,7 @@ int handleExceptions(const string & programName, std::function<void()> fun)
|
|||
ReceiveInterrupts receiveInterrupts; // FIXME: need better place for this
|
||||
|
||||
ErrorInfo::programName = baseNameOf(programName);
|
||||
ErrorInfo::showTrace = settings.showTrace;
|
||||
|
||||
string error = ANSI_RED "error:" ANSI_NORMAL " ";
|
||||
try {
|
||||
|
@ -323,9 +324,6 @@ int handleExceptions(const string & programName, std::function<void()> fun)
|
|||
printError("Try '%1% --help' for more information.", programName);
|
||||
return 1;
|
||||
} catch (BaseError & e) {
|
||||
// TODO showTrace as argument, or have calcWhat check settings?
|
||||
// if (settings.showTrace && e.prefix() != "")
|
||||
// printError(e.prefix());
|
||||
logError(e.info());
|
||||
// TODO fix to detect non-empty trace here.
|
||||
if (e.hasTrace() && !settings.showTrace)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue