Skip to main content

SkillError

Enum SkillError 

Source
pub enum SkillError {
    MissingFrontmatter {
        skill: String,
    },
    MissingRequiredField {
        skill: String,
        field: &'static str,
    },
    InvalidFieldType {
        skill: String,
        field: &'static str,
        reason: String,
    },
    UnknownCategory {
        skill: String,
        category: String,
    },
    InvalidYaml {
        skill: String,
        source: Error,
    },
    NotFound {
        name: String,
        source_name: &'static str,
    },
    Io {
        path: PathBuf,
        source: Error,
    },
    InvalidManifest {
        path: PathBuf,
        source: Error,
    },
    SerdeJson {
        operation: &'static str,
        path: PathBuf,
        source: Error,
    },
}
Expand description

Errors that can surface while loading, parsing, or installing a skill.

Variants§

§

MissingFrontmatter

The skill body did not open with a YAML frontmatter block (--- at line 1, closing --- on a subsequent line).

Fields

§skill: String

Identifier of the offending skill (directory name).

§

MissingRequiredField

The YAML frontmatter parsed but did not contain a required field.

Fields

§skill: String

Identifier of the offending skill.

§field: &'static str

Name of the missing field.

§

InvalidFieldType

The YAML frontmatter parsed but a field had the wrong type.

Fields

§skill: String

Identifier of the offending skill.

§field: &'static str

Name of the offending field.

§reason: String

Why the value is rejected.

§

UnknownCategory

The category field references a category that is not in the known enum. Provide one of the shipped categories (self-bootstrap, issue-tracking, code-review, self-feedback, meeting-notes, messenger) or extend crate::skill::Category before shipping a new one.

Fields

§skill: String

Identifier of the offending skill.

§category: String

The string that failed to parse as a category.

§

InvalidYaml

Underlying YAML parser failure (syntax error inside the frontmatter).

Fields

§skill: String

Identifier of the offending skill.

§source: Error

Wrapped YAML error.

§

NotFound

A skill lookup was asked for a name that the source does not know about.

Fields

§name: String

Name that was requested.

§source_name: &'static str

The source that was queried.

§

Io

Filesystem operation failed while reading or writing a skill / manifest.

Fields

§path: PathBuf

Path that was being accessed.

§source: Error

Wrapped IO error.

§

InvalidManifest

Manifest JSON parse failure.

Fields

§path: PathBuf

Path to the offending manifest.

§source: Error

Wrapped serde_json error.

§

SerdeJson

Non-manifest JSON (de)serialisation failure — used by the trace subsystem for trace.jsonl records and meta.json writes so callers do not see a misleading “manifest … invalid JSON” error for a record that is not a manifest.

Fields

§operation: &'static str

What was being done when the failure happened (serialise trace record, write session meta, …).

§path: PathBuf

Path associated with the record.

§source: Error

Wrapped serde_json error.

Trait Implementations§

Source§

impl Debug for SkillError

Source§

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

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

impl Display for SkillError

Source§

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

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

impl Error for SkillError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V