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

Improve rendering of ignored exceptions

Instead of

  error (ignored): error: SQLite database '...' is busy

we now get

  error (ignored): SQLite database '...' is busy
This commit is contained in:
Eelco Dolstra 2025-07-15 18:09:06 +02:00
parent e8314e69ab
commit fde6068874

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());
}
}