pub enum ErrorCode {
Show 54 variants
CaptureTargetNotFound,
CommandFailed,
EditorConflict,
EncodeFailed,
FileNotFound,
IdConflict,
ImportFailed,
InvalidAgendaFile,
InvalidAgendaPattern,
InvalidArguments,
InvalidBatch,
InvalidBody,
InvalidCapture,
InvalidConfig,
InvalidDate,
InvalidEdit,
InvalidIdChange,
InvalidImport,
InvalidJournal,
InvalidJournalState,
InvalidMatch,
InvalidNote,
InvalidPatch,
InvalidPath,
InvalidPlan,
InvalidPriority,
InvalidPrompt,
InvalidProperty,
InvalidQuery,
InvalidRange,
InvalidRef,
InvalidRefile,
InvalidRepeater,
InvalidRoot,
InvalidSpan,
InvalidTag,
InvalidTemplate,
InvalidTitle,
InvalidTodo,
InvalidUtf8,
InvalidView,
IoFailed,
JournalConflict,
JournalFailed,
JournalNotFound,
LockFailed,
ParseFailed,
PathConflict,
RefConflict,
UndoConflict,
UnknownProfile,
UnknownTemplate,
UnknownView,
WalkFailed,
}Expand description
Every agd.error/v1 code, in one place, for agd-core and the agd
binary alike: each variant’s as_str is the snake_case code consumers
match on, and an error is raised as AgdError::new(ErrorCode::Variant, message). agd setup check reports its problems with the same codes.
Every name follows one rule (see the module documentation):
invalid_<thing>, unknown_<thing>, <thing>_not_found,
<thing>_conflict or <thing>_failed.
Variants§
CaptureTargetNotFound
A capture template’s heading, outline path or ID target that is missing, or not unique on its level.
CommandFailed
A command that failed outside agd-core’s own errors, such as output that cannot be written.
EditorConflict
A file an editor holds unsaved changes for: an Emacs .# lock exists.
EncodeFailed
A result that cannot be encoded as JSON.
FileNotFound
A file that is not under any root, or cannot be resolved.
IdConflict
An :ID: that more than one heading under the roots has, or that a
write would give a second heading.
ImportFailed
Editor configuration that cannot be found or read for an import.
InvalidAgendaFile
An agenda file entry without the .org extension.
InvalidAgendaPattern
An agenda file pattern that is not a valid glob, or an absolute entry that is not an exact file under a root.
InvalidArguments
A command line, or an MCP tool call’s arguments, that do not parse: an unknown flag or argument, a missing value, a value of the wrong type.
InvalidBatch
A batch of edits that lists one item twice.
InvalidBody
A capture body line that would start a heading.
InvalidCapture
A capture line whose title is empty.
InvalidConfig
A config file that is missing, unreadable or holds an invalid value, or a config or data directory that cannot be determined.
InvalidDate
A date or time that does not parse; the message lists the forms it takes.
InvalidEdit
An edit that would change nothing: it names no change, or the item’s bytes would stay as they are.
InvalidIdChange
A change to, or removal of, a heading’s existing :ID:.
InvalidImport
Imported editor configuration agd cannot turn into a config that loads.
InvalidJournal
A journal line that is not a record, or an inverse patch that does not restore the bytes the entry recorded.
InvalidJournalState
A review or undo of a journal entry in the wrong state: a review of one not awaiting review, an undo of one that is not a committed change.
InvalidMatch
A tags/TODO match expression that does not parse.
InvalidNote
A log note of several lines.
InvalidPatch
A patch that overlaps another, runs past the source or splits a UTF-8 character.
InvalidPath
A path agd will not touch: with a .. segment, outside the roots, a
symlink to write through, without a parent, or not a regular file.
InvalidPlan
An MCP plan call with neither a scheduled nor a deadline date.
InvalidPriority
A priority outside the file’s range.
InvalidPrompt
A capture template prompt with no answer, or an answer of several lines.
InvalidProperty
A property key outside [A-Za-z0-9_-], or a value of several lines.
InvalidQuery
An org-ql query that does not parse; the message lists the supported predicates.
InvalidRange
An agenda range that ends before it starts.
InvalidRef
An item ref that is neither an ID nor file:line#sha256:digest.
InvalidRefile
A refile into the item itself or its subtree, or one that would leave a heading without stars.
InvalidRepeater
A repeater that does not parse, repeats every 0 units, or repeats past the calendar.
InvalidRoot
No roots, or a root that cannot be resolved, is not a directory or is listed twice.
InvalidSpan
An agenda span that is not day, week, month or a number of days.
InvalidTag
A tag with characters outside Org’s tag characters.
InvalidTemplate
A capture template agd cannot use: one with a %(sexp) form, which
agd never runs, or one with neither a file nor an ID target.
InvalidTitle
A title that is not one line, that is cleared, or that the parser would read as a TODO keyword, priority cookie or tags.
InvalidTodo
A TODO state the item’s file does not define.
InvalidUtf8
An org file that is not UTF-8.
InvalidView
A view group’s effort bound that is not a duration.
IoFailed
A file system operation that failed; the message names the path.
JournalConflict
A write met an interrupted earlier write whose file changed since.
JournalFailed
A journal record that cannot be encoded.
JournalNotFound
A journal entry or transaction id that is not in the journal, or no
entry that agd undo may undo.
LockFailed
A write lock that cannot be opened or taken.
ParseFailed
A file agd cannot read faithfully: the Org parser would not reproduce it byte for byte, its text does not read as agd expects (an unterminated property drawer), or a written heading cannot be found again.
PathConflict
A relative path more than one root could hold.
RefConflict
A ref whose heading changed, moved out of the agenda files or no
longer exists since it was read; the error’s current is the item
as it reads now, when there is one.
UndoConflict
An undo whose change was edited since; nothing is written.
UnknownProfile
An agent profile name that is not configured.
UnknownTemplate
A capture template key that is not configured.
UnknownView
A view key that names no view, or --view without a key when no
start_view is set.
WalkFailed
A directory under a root that cannot be listed.