pub enum CodegenError {
Show 23 variants
Config(PackagingError),
ProjectName {
name: String,
reason: String,
},
SchemaOutsideSchemasDir {
field: String,
path: PathBuf,
},
SchemasDirMissing {
path: PathBuf,
},
SchemasDirEmpty {
path: PathBuf,
},
SchemasDirRead {
path: PathBuf,
source: Error,
},
SchemaRead {
path: PathBuf,
source: Error,
},
SchemaParse {
path: PathBuf,
source: Error,
},
SchemaFileName {
path: PathBuf,
reason: String,
},
UnsupportedConstruct {
file: PathBuf,
pointer: String,
construct: String,
},
NameCollision {
name: String,
first_file: PathBuf,
first_pointer: String,
second_file: PathBuf,
second_pointer: 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,
},
ActivitySchemaMissing {
activity: String,
role: &'static str,
type_name: String,
path: PathBuf,
},
GoldenTypeUnresolved {
root_type: String,
missing: String,
file: PathBuf,
},
EntrySourceRead {
path: PathBuf,
source: Error,
},
ScaffoldFacts {
path: PathBuf,
reason: String,
},
}Expand description
Errors produced while generating Gleam types and codecs from a workflow project’s JSON Schemas.
Every variant carries the offending file, JSON pointer, or path as structured data so callers can render actionable guidance. Schema-shape failures always name the schema file and the JSON pointer of the offending construct.
Variants§
Config(PackagingError)
The project descriptor (workflow.toml) or a schema it references
failed to load: missing descriptor, invalid TOML, a referenced schema
file that does not exist, or invalid JSON in a referenced schema.
ProjectName
The project’s gleam.toml declares a package name that cannot prefix
a generated Gleam module.
SchemaOutsideSchemasDir
A workflow.toml entry references a schema outside the project’s
schemas/ directory, where codegen would never see it; schema/codec
drift protection requires every referenced schema to live there.
Fields
SchemasDirMissing
The project has no schemas/ directory to generate from.
SchemasDirEmpty
The schemas/ directory exists but contains no *.json files.
SchemasDirRead
The schemas/ directory could not be listed.
Fields
SchemaRead
A schema file could not be read.
Fields
SchemaParse
A schema file is not valid JSON (including duplicate object keys, which would make property order ambiguous).
Fields
SchemaFileName
A schema file name cannot derive a Gleam type name.
Fields
UnsupportedConstruct
A schema uses a construct outside the supported v1 subset.
Fields
NameCollision
Two schema locations derive the same generated Gleam name.
Fields
Write
The generated module could not be written.
Fields
CheckMissing
--check failed: the generated module does not exist on disk.
CheckDrift
--check failed: the on-disk module differs from the generated output.
CheckRead
The on-disk module could not be read for --check comparison.
Fields
ManifestParse
The activity manifest JSON emitted by the package’s manifest() export
is not a valid declaration array.
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).
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.
UnknownTier
A declaration carries a tier outside the supported set.
ActivitySchemaMissing
A declared activity references a value type with no schemas/<type>.json
document, so its codec cannot be generated.
Fields
GoldenTypeUnresolved
While deriving a wire-compat golden, a value type referenced a named Gleam type absent from its schema artifact’s definitions. The schema walker emits every nested record and enum into the artifact, so this signals a generator invariant violation rather than bad author input.
Fields
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
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).
Trait Implementations§
Source§impl Debug for CodegenError
impl Debug for CodegenError
Source§impl Display for CodegenError
impl Display for CodegenError
Source§impl Error for CodegenError
impl Error for CodegenError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()