mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
addErrorTrace
This commit is contained in:
parent
4d1a4f0217
commit
54e8f550c9
8 changed files with 270 additions and 220 deletions
|
@ -323,11 +323,13 @@ int handleExceptions(const string & programName, std::function<void()> fun)
|
|||
printError("Try '%1% --help' for more information.", programName);
|
||||
return 1;
|
||||
} catch (BaseError & e) {
|
||||
if (settings.showTrace && e.prefix() != "")
|
||||
printError(e.prefix());
|
||||
// TODO showTrace as argument, or have calcWhat check settings?
|
||||
// if (settings.showTrace && e.prefix() != "")
|
||||
// printError(e.prefix());
|
||||
logError(e.info());
|
||||
if (e.prefix() != "" && !settings.showTrace)
|
||||
printError("(use '--show-trace' to show detailed location information)");
|
||||
// TODO fix to detect non-empty trace here.
|
||||
// if (e.prefix() != "" && !settings.showTrace)
|
||||
// printError("(use '--show-trace' to show detailed location information)");
|
||||
return e.status;
|
||||
} catch (std::bad_alloc & e) {
|
||||
printError(error + "out of memory");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue