1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::resolve::ResolverError;
use fluent_syntax::parser::ParserError;

#[derive(Debug, PartialEq)]
pub enum FluentError {
    Overriding { kind: &'static str, id: String },
    ParserError(ParserError),
    ResolverError(ResolverError),
}

impl From<ResolverError> for FluentError {
    fn from(error: ResolverError) -> Self {
        FluentError::ResolverError(error)
    }
}

impl From<ParserError> for FluentError {
    fn from(error: ParserError) -> Self {
        FluentError::ParserError(error)
    }
}