nmd_core/compilation/
compilation_error.rs

1use thiserror::Error;
2use crate::{assembler::AssemblerError, compilable_text::CompilableError, resource::{resource_reference::ResourceReferenceError, ResourceError}};
3
4
5#[derive(Error, Debug)]
6pub enum CompilationError {
7
8    #[error("bucket of errors: '{0:#?}'")]
9    BucketOfErrors(Vec<CompilationError>),
10
11    #[error(transparent)]
12    AssemblerError(#[from] AssemblerError),
13
14    #[error("pattern provided '{0}' is invalid")]
15    InvalidPattern(String),
16
17    #[error("'{0}' is an invalid source")]
18    InvalidSource(String),
19
20    #[error("failed during elaboration")]
21    ElaborationError,
22
23    #[error("failed during elaboration: {0}")]
24    ElaborationErrorVerbose(String),
25
26    #[error("document name not found")]
27    DocumentNameNotFound,
28
29    #[error("'{0}' is an invalid parameter")]
30    InvalidParameter(String),
31
32    #[error(transparent)]
33    ReferenceError(#[from] ResourceReferenceError),
34
35    #[error(transparent)]
36    ResourceError(#[from] ResourceError),
37
38    #[error(transparent)]
39    CompilableError(#[from] CompilableError),
40
41    #[error("heading level not inferable: {0}")]
42    HeadingLevelNotInferable(String),
43
44    #[error("unknown error occurs")]
45    Unknown,
46}