Skip to content

Commit

Permalink
Merge pull request #10361 from obsidiansystems/fix-exception-type
Browse files Browse the repository at this point in the history
`throwExceptionSelfCheck` throw `Error`
  • Loading branch information
Ericson2314 committed Mar 29, 2024
2 parents b72e1c7 + 555181c commit eeecbb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libutil/error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ void BaseError::addTrace(std::shared_ptr<Pos> && e, HintFmt hint, TracePrint pri
err.traces.push_front(Trace { .pos = std::move(e), .hint = hint, .print = print });
}

void throwExceptionSelfCheck(){
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.");
throw Error("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.
Expand Down

0 comments on commit eeecbb9

Please sign in to comment.