Skip to main content

ErrorCode

Enum ErrorCode 

Source
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.

Implementations§

Source§

impl ErrorCode

Source

pub fn as_str(self) -> &'static str

Trait Implementations§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ErrorCode

Source§

impl Debug for ErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ErrorCode

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ErrorCode

Source§

impl PartialEq for ErrorCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more