60 | @@ -60,7 +61,8 @@ bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data
61 | if (fileout.IsNull()) {
62 | fileout.fclose();
63 | remove(pathTmp);
64 | - return error("%s: Failed to open file %s", __func__, fs::PathToString(pathTmp));
65 | + LogError("%s: Failed to open file %s\n", __func__, fs::PathToString(pathTmp));
nit: it seems the return value from SerializeFileDB is never used to actually shut down the node. In the case of failing to open file, I think LogError is appropriate because that probably should lead to a shutdown. In the case of "Failed to flush file", I think a LogWarning could be more appropriate.
I think it's best to leave the PR as is to make progress, bikeshedding over warning vs error categories doesn't have a huge amount of benefit here. Just leaving this comment for visibility.
Yeah, but "error" is still applicable within the addrdb functions, as they can not continue and must return. So I think, ideally they'd return Result<void>, and the caller could downgrade the error to a warning and log it? Happy to review such a change, if someone creates it.