Skip to main content

olai_codegen/
error.rs

1pub type Result<T, E = Error> = std::result::Result<T, E>;
2
3#[derive(thiserror::Error, Debug)]
4pub enum Error {
5    #[error("Build error: {0}")]
6    Build(String),
7
8    #[error("bindings config is required when python, node, or node_ts output is enabled")]
9    MissingBindingsConfig,
10
11    #[error("Missing annotation for {object}: {message}")]
12    MissingAnnotation { object: String, message: String },
13
14    #[error("Invalid annotation for {object}: {message}")]
15    InvalidAnnotation { object: String, message: String },
16
17    #[error("Invalid models_path template `{template}`: {source}")]
18    InvalidModelsPathTemplate {
19        template: String,
20        #[source]
21        source: syn::Error,
22    },
23
24    #[error("Missing HTTP rule pattern for method `{method}`")]
25    MissingHttpPattern { method: String },
26
27    #[error("IO error: {0}")]
28    Io(#[from] std::io::Error),
29
30    #[error(transparent)]
31    Other(#[from] Box<dyn std::error::Error + Send + Sync>),
32}