mirror of
https://github.com/NixOS/nix
synced 2025-06-26 11:41:15 +02:00
initLibUtil: Add exception handling self-check
This commit is contained in:
parent
010dc7958e
commit
c4dbb55ba9
3 changed files with 26 additions and 0 deletions
|
@ -14,6 +14,11 @@ void BaseError::addTrace(std::shared_ptr<AbstractPos> && e, hintformat hint, boo
|
|||
err.traces.push_front(Trace { .pos = std::move(e), .hint = hint, .frame = frame });
|
||||
}
|
||||
|
||||
void throwExceptionSelfCheck(){
|
||||
// This is meant to be caught in initLibUtil()
|
||||
throw SysError("C++ exception handling is broken. This would appear to be a problem with the way Nix was compiled and/or linked and/or loaded.");
|
||||
}
|
||||
|
||||
// c++ std::exception descendants must have a 'const char* what()' function.
|
||||
// This stringifies the error and caches it for use by what(), or similarly by msg().
|
||||
const std::string & BaseError::calcWhat() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue