mirror of
https://github.com/NixOS/nix
synced 2024-10-18 00:16:11 -04:00
Merge 920b87f94b
into 806a91f7bf
This commit is contained in:
commit
f04bd20788
|
@ -158,7 +158,12 @@ protected:
|
|||
|
||||
};
|
||||
|
||||
MakeError(SQLiteBusy, SQLiteError);
|
||||
struct SQLiteBusy : SQLiteError
|
||||
{
|
||||
SQLiteBusy(const char *path, const char *errMsg, int errNo, int extendedErrNo, int offset, HintFmt && hf)
|
||||
: SQLiteError(path, errMsg, errNo, extendedErrNo, offset, std::move(hf))
|
||||
{ err.level = lvlWarn; }
|
||||
};
|
||||
|
||||
void handleSQLiteBusy(const SQLiteBusy & e, time_t & nextWarning);
|
||||
|
||||
|
|
|
@ -28,8 +28,12 @@ void throwExceptionSelfCheck()
|
|||
// This stringifies the error and caches it for use by what(), or similarly by msg().
|
||||
const std::string & BaseError::calcWhat() const
|
||||
{
|
||||
if (what_.has_value())
|
||||
if (what_.has_value()) {
|
||||
if (err.level == Verbosity::lvlWarn) {
|
||||
removeErrorPrefix(*what_);
|
||||
}
|
||||
return *what_;
|
||||
}
|
||||
else {
|
||||
std::ostringstream oss;
|
||||
showErrorInfo(oss, err, loggerSettings.showTrace);
|
||||
|
|
|
@ -341,6 +341,12 @@ bool handleJSONLogMessage(const std::string & msg,
|
|||
return handleJSONLogMessage(*json, act, activities, trusted);
|
||||
}
|
||||
|
||||
void removeErrorPrefix(std::string & msg)
|
||||
{
|
||||
if (hasPrefix(msg, "error: "))
|
||||
msg.erase(0, 7);
|
||||
}
|
||||
|
||||
Activity::~Activity()
|
||||
{
|
||||
try {
|
||||
|
|
|
@ -256,4 +256,6 @@ inline void warn(const std::string & fs, const Args & ... args)
|
|||
|
||||
void writeToStderr(std::string_view s);
|
||||
|
||||
void removeErrorPrefix(std::string & msg);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue