nmd_core/compilation/
compilation_error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use thiserror::Error;
use crate::{assembler::AssemblerError, compilable_text::CompilableError, resource::{resource_reference::ResourceReferenceError, ResourceError}};


#[derive(Error, Debug)]
pub enum CompilationError {

    #[error("bucket of errors: '{0:#?}'")]
    BucketOfErrors(Vec<CompilationError>),

    #[error(transparent)]
    AssemblerError(#[from] AssemblerError),

    #[error("pattern provided '{0}' is invalid")]
    InvalidPattern(String),

    #[error("'{0}' is an invalid source")]
    InvalidSource(String),

    #[error("failed during elaboration")]
    ElaborationError,

    #[error("failed during elaboration: {0}")]
    ElaborationErrorVerbose(String),

    #[error("document name not found")]
    DocumentNameNotFound,

    #[error("'{0}' is an invalid parameter")]
    InvalidParameter(String),

    #[error(transparent)]
    ReferenceError(#[from] ResourceReferenceError),

    #[error(transparent)]
    ResourceError(#[from] ResourceError),

    #[error(transparent)]
    CompilableError(#[from] CompilableError),

    #[error("heading level not inferable: {0}")]
    HeadingLevelNotInferable(String),

    #[error("unknown error occurs")]
    Unknown,
}