mirror of
https://github.com/NixOS/nix
synced 2025-06-26 11:41:15 +02:00
Make abort() call sites log first
This commit is contained in:
parent
e48e0cbab0
commit
3172e88af5
35 changed files with 88 additions and 45 deletions
|
@ -430,4 +430,16 @@ std::ostream & showErrorInfo(std::ostream & out, const ErrorInfo & einfo, bool s
|
|||
return out;
|
||||
}
|
||||
|
||||
void panic(std::string_view msg)
|
||||
{
|
||||
printError(msg);
|
||||
printError("This was a fatal error, aborting.");
|
||||
abort();
|
||||
}
|
||||
|
||||
void panic(const char * file, int line, const char * func)
|
||||
{
|
||||
panic(std::string("Unexpected condition in ") + func + " at " + file + ":" + std::to_string(line));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue