1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 17:04:47 +02:00

Make being unable to write the database fatal as it was in db_flatifle.

This commit is contained in:
Sadie Powell
2026-02-06 17:17:08 +00:00
parent de122145d9
commit e6fcf3ffb3
+3 -2
View File
@@ -433,8 +433,9 @@ public:
const auto flags = YYJSON_WRITE_ALLOW_INVALID_UNICODE | YYJSON_WRITE_NEWLINE_AT_END | YYJSON_WRITE_PRETTY;
if (!yyjson_mut_write_file(dbname.c_str(), doc, flags, nullptr, &errmsg))
{
Log(this) << "Unable to write " << dbname << ": error #" << errmsg.code << ": " << errmsg.msg;
// TODO: exit??? retry???
Anope::Quitting = true;
Anope::QuitReason = "Unable to write " + dbname + ": error #" + Anope::ToString(errmsg.code) + ": " + errmsg.msg;
Log(this) << Anope::QuitReason;
}
yyjson_mut_doc_free(doc);