From e6fcf3ffb30b87dc3a4611a8cecf1f7c5e6993a7 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 6 Feb 2026 17:17:08 +0000 Subject: [PATCH] Make being unable to write the database fatal as it was in db_flatifle. --- modules/database/db_json.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/database/db_json.cpp b/modules/database/db_json.cpp index 436e8331c..0be89ba04 100644 --- a/modules/database/db_json.cpp +++ b/modules/database/db_json.cpp @@ -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);