pub enum CodegenError {
Show 15 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,
},
}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.
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()