1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 07:22:43 +01:00

Merge pull request #13476 from NixOS/improve-ignored-exceptions

Improve rendering of ignored exceptions
This commit is contained in:
Jörg Thalheim 2025-07-17 15:57:59 +02:00 committed by GitHub
commit 36d451ddf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -190,8 +190,10 @@ void ignoreExceptionInDestructor(Verbosity lvl)
try {
try {
throw;
} catch (Error & e) {
printMsg(lvl, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.info().msg);
} catch (std::exception & e) {
printMsg(lvl, "error (ignored): %1%", e.what());
printMsg(lvl, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.what());
}
} catch (...) { }
}
@ -202,8 +204,10 @@ void ignoreExceptionExceptInterrupt(Verbosity lvl)
throw;
} catch (const Interrupted & e) {
throw;
} catch (Error & e) {
printMsg(lvl, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.info().msg);
} catch (std::exception & e) {
printMsg(lvl, "error (ignored): %1%", e.what());
printMsg(lvl, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.what());
}
}