From 71533b10893298f5fb4bfc28ec6ebbab5bb54efd Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Sat, 29 Aug 2026 20:31:13 -0500 Subject: [PATCH] document the remaining error-set members Every member of every public error set now carries a doc comment; CloseError's XapianException notes that the database has still been closed but changes may not have been flushed. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_017i7R7ReKJAHGQpitxGXqrb --- src/Database.zig | 8 +++++++- src/Directory.zig | 2 ++ src/Message.zig | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Database.zig b/src/Database.zig index 8edd0aa..ba8125d 100644 --- a/src/Database.zig +++ b/src/Database.zig @@ -371,7 +371,13 @@ test create { try std.testing.expect(r == .ok); } -pub const CloseError = error{ XapianException, Unexpected }; +pub const CloseError = error{ + /// A Xapian exception occurred. The database has still been closed, but + /// there is no guarantee that any changes were flushed to disk. + XapianException, + /// libnotmuch returned an undocumented status code. + Unexpected, +}; /// Commit changes and close the given notmuch database. /// diff --git a/src/Directory.zig b/src/Directory.zig index a051339..c1c284d 100644 --- a/src/Directory.zig +++ b/src/Directory.zig @@ -56,6 +56,7 @@ pub fn getMtime(self: *const Directory) ?i64 { } pub const GetChildFilesError = error{ + /// A Xapian exception occurred. XapianException, }; @@ -71,6 +72,7 @@ pub fn getChildFiles(self: *const Directory) GetChildFilesError!FilenamesIterato } pub const GetChildDirectoriesError = error{ + /// A Xapian exception occurred. XapianException, }; diff --git a/src/Message.zig b/src/Message.zig index 631f48f..bbfd8eb 100644 --- a/src/Message.zig +++ b/src/Message.zig @@ -98,6 +98,7 @@ pub fn countFiles(self: *const Message) CountFilesError!usize { } pub const GetFilenameError = error{ + /// A Xapian exception occurred. XapianException, }; @@ -121,6 +122,7 @@ pub fn getFilename(self: *const Message) GetFilenameError![:0]const u8 { } pub const GetFilenamesError = error{ + /// A Xapian exception occurred. XapianException, }; @@ -158,6 +160,7 @@ pub fn reindex(self: *const Message, indexopts: ?IndexOpts) Error!void { } pub const GetFlagError = error{ + /// A Xapian exception occurred. XapianException, /// libnotmuch returned an undocumented status code. Unexpected, @@ -270,6 +273,7 @@ pub fn removeTag(self: *const Message, tag: [:0]const u8) RemoveTagError!void { pub const RemoveAllTagsError = error{ /// Database was opened in read-only mode so message cannot be modified. ReadOnlyDatabase, + /// A Xapian exception occurred. XapianException, /// libnotmuch returned an undocumented status code. Unexpected, @@ -320,6 +324,7 @@ pub fn maildirFlagsToTags(self: *const Message) Error!void { } pub const HasMaildirFlagError = error{ + /// A Xapian exception occurred. XapianException, /// libnotmuch returned an undocumented status code. Unexpected, -- 2.51.2