satay_codegen/error.rs
1mod parse;
2mod validation;
3
4pub use parse::ParseError;
5pub use validation::ValidationError;
6
7/// All errors that can occur during code generation.
8///
9/// This enum is [`non_exhaustive`](https://doc.rust-lang.org/reference/attributes/type_system.html)
10/// so new variants may be added in future releases without a semver break.
11#[derive(Debug, thiserror::Error)]
12#[non_exhaustive]
13pub enum Error {
14 /// An error that occurred while parsing an OpenAPI document.
15 ///
16 /// See [`ParseError`] for the full list of parse-related errors.
17 #[error(transparent)]
18 Parse(#[from] ParseError),
19
20 /// An error that occurred while validating an OpenAPI document.
21 ///
22 /// See [`ValidationError`] for the full list of validation-related errors.
23 #[error(transparent)]
24 Validation(#[from] ValidationError),
25}