Skip to main content

CodegenError

Enum CodegenError 

Source
pub enum CodegenError {
Show 22 variants Config(PackagingError), ProjectName { name: String, reason: String, }, InterfaceParse { source: Error, }, TypesModuleMissing { module: String, }, TypesModuleNotTypesOnly { module: String, offenders: Vec<String>, }, TypesModuleEmpty { module: String, }, UnsupportedType { module: String, type_name: String, field: Option<String>, found: String, hint: String, }, SchemaStray { path: PathBuf, }, SchemasDirRead { path: PathBuf, source: Error, }, UnsupportedConstruct { file: PathBuf, pointer: String, construct: String, }, Write { path: PathBuf, source: Error, }, CheckMissing { path: PathBuf, }, CheckDrift { path: PathBuf, }, CheckRead { path: PathBuf, source: Error, }, ManifestParse { source: Error, }, InvalidActivityName { name: String, reason: String, }, DuplicateActivity { name: String, }, UnknownTier { value: String, }, ActivityTypeMissing { activity: String, role: &'static str, type_name: String, module: String, }, GoldenTypeUnresolved { root_type: String, missing: String, file: PathBuf, }, EntrySourceRead { path: PathBuf, source: Error, }, ScaffoldFacts { path: PathBuf, reason: String, },
}
Expand description

Errors produced while generating codecs, schemas, and activity plumbing from a workflow project’s authored types module.

Variants§

§

Config(PackagingError)

The project descriptor (workflow.toml) or a schema it references failed to load.

§

ProjectName

The project’s gleam.toml declares a package name that cannot prefix a generated Gleam module.

Fields

§name: String

The declared package name.

§reason: String

Why the name cannot be used.

§

InterfaceParse

The gleam export package-interface JSON did not parse into the expected shape. The format is owned by the Gleam compiler; an unknown shape fails loudly rather than being guessed at.

Fields

§source: Error

JSON parsing failure reported by serde_json.

§

TypesModuleMissing

The exported interface has no types module for the package.

Fields

§module: String

The expected types-module name (<package>_io).

§

TypesModuleNotTypesOnly

The types module exports functions, constants, or type aliases.

Fields

§module: String

The types-module name.

§offenders: Vec<String>

The offending exports (fn x, const y, type alias z).

§

TypesModuleEmpty

The types module declares no public types.

Fields

§module: String

The types-module name.

§

UnsupportedType

A type in the types module falls outside the supported v1 subset.

Fields

§module: String

The types-module name.

§type_name: String

The offending type.

§field: Option<String>

The offending field, when the construct is field-scoped.

§found: String

What was found.

§hint: String

How to fix it.

§

SchemaStray

A hand-authored (unmarked) *.json file sits in the schemas/ directory, which holds generated artifacts only.

Fields

§path: PathBuf

The stray file.

§

SchemasDirRead

The schemas/ directory could not be listed.

Fields

§path: PathBuf

The schemas/ directory that could not be listed.

§source: Error

I/O failure reported while listing the directory.

§

UnsupportedConstruct

A schema uses a construct outside the supported v1 subset (the aion input skeleton walks the emitted schema documents).

Fields

§file: PathBuf

The schema file containing the construct.

§pointer: String

JSON pointer to the offending construct ( is the document root).

§construct: String

What the construct was and, where helpful, what is supported.

§

Write

A generated file could not be written.

Fields

§path: PathBuf

The path that could not be written.

§source: Error

I/O failure reported while writing.

§

CheckMissing

--check failed: a generated file does not exist on disk.

Fields

§path: PathBuf

The expected generated file path.

§

CheckDrift

--check failed: an on-disk file differs from the generated output.

Fields

§path: PathBuf

The drifted generated file path.

§

CheckRead

An on-disk file could not be read for --check comparison.

Fields

§path: PathBuf

The path that could not be read.

§source: Error

I/O failure reported while reading.

§

ManifestParse

The activity manifest JSON emitted by the package’s manifest() export is not a valid declaration array.

Fields

§source: Error

JSON parsing failure reported by serde_json.

§

InvalidActivityName

A declared activity name cannot name an engine activity or a generated artifact (empty, or carrying a path separator, backslash, or the deployed-name separator).

Fields

§name: String

The offending activity name.

§reason: String

Why the name cannot be used.

§

DuplicateActivity

Two declarations share an activity name; names must be unique within a package so the generated wrappers, registration entries, and workflow.toml list are unambiguous.

Fields

§name: String

The duplicated activity name.

§

UnknownTier

A declaration carries a tier outside the supported set.

Fields

§value: String

The unrecognised tier string.

§

ActivityTypeMissing

A declared activity references a value type not declared in the types module, so its codec cannot be generated.

Fields

§activity: String

The activity whose type is unresolved.

§role: &'static str

Which side of the activity the type is on (input or output).

§type_name: String

The unresolved value type name.

§module: String

The types module the type was expected in (<package>_io).

§

GoldenTypeUnresolved

While deriving a wire-compat golden, a value type referenced a named Gleam type absent from its boundary-type definitions. The interface front-end collects every referenced definition into the closure, so this signals a generator invariant violation rather than bad author input.

Fields

§root_type: String

The value type whose golden was being derived.

§missing: String

The named type that could not be found in the definitions.

§file: PathBuf

The emitted schema artifact whose definitions were searched.

§

EntrySourceRead

The test-scaffold generator could not read the workflow’s entry-module source, which it needs to derive the typed entry function and timer count.

Fields

§path: PathBuf

The entry-module source path that could not be read.

§source: Error

The underlying I/O error.

§

ScaffoldFacts

The workflow’s entry-module source does not yield the facts the test scaffold needs (no aion/workflow import, no define call, or an unidentifiable typed entry function).

Fields

§path: PathBuf

The entry-module source path the facts were read from.

§reason: String

Why the facts could not be derived.

Trait Implementations§

Source§

impl Debug for CodegenError

Source§

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

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

impl Display for CodegenError

Source§

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

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

impl Error for CodegenError

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

impl From<PackagingError> for CodegenError

Source§

fn from(source: PackagingError) -> Self

Converts to this type from the input type.

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.