xsd_parser/pipeline/renderer/error.rs
1use thiserror::Error;
2
3use crate::models::{code::InvalidIdentPath, schema::NamespaceId};
4
5/// Error that might be raised by the [`Generator`](crate::Generator).
6#[derive(Debug, Error)]
7pub enum Error {
8 /// Unknown namespace.
9 ///
10 /// Is raised if a specific namespace id could not be resolved to it's
11 /// corresponding namespace information.
12 #[error("Unknown namespace: {0:?}!")]
13 UnknownNamespace(NamespaceId),
14
15 /// Invalid identifier.
16 ///
17 /// Is raised if the user passed a invalid identifier.
18 #[error("{0}")]
19 InvalidIdentifier(
20 #[from]
21 #[source]
22 InvalidIdentPath,
23 ),
24}