0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-29 08:54:02 +01:00

ircd::db: Improve error string generation; cases for custom severity.

This commit is contained in:
Jason Volk 2020-02-27 14:48:19 -08:00
parent 7dd821fd55
commit 79786f7076

View file

@ -7268,11 +7268,12 @@ ircd::db::error::error(const rocksdb::Status &s)
{ {
fmt::sprintf fmt::sprintf
{ {
buf, "(%u:%u:%u %s) :%s", buf, "(%u:%u:%u) %s %s :%s",
this->code, this->code,
this->subcode, this->subcode,
this->severity, this->severity,
reflect(s.severity()), reflect(rocksdb::Status::Severity(this->severity)),
reflect(rocksdb::Status::Code(this->code)),
s.getState(), s.getState(),
}; };
} }
@ -7293,7 +7294,13 @@ ircd::db::error::error(generate_skip_t,
} }
,severity ,severity
{ {
s.severity() s.severity()?
s.severity():
code == rocksdb::Status::kCorruption?
rocksdb::Status::kHardError:
rocksdb::Status::kNoError
} }
{ {
} }