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
use std::path::PathBuf;

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error(transparent)]
    IoError(#[from] std::io::Error),

    #[error(transparent)]
    PathPrefixError(#[from] std::path::StripPrefixError),

    #[error("Path contans invalid symbols: {0}")]
    InvalidPath(PathBuf),

    #[error("Path doesn not match the expected format {0}")]
    InvalidPathFormat(PathBuf),

    #[error("Error parsing fluent resource")]
    FluentParserError {
        errors: Vec<fluent_syntax::parser::ParserError>,
    },

    #[error("Found unsupported feature {feature}: {id}")]
    UnsupportedFeature { feature: String, id: String },

    #[error("No l10n resources found for fallback language {0}")]
    FallbackLanguageNotFound(String),

    #[error("Message bundle {bundle} integrity validation failed")]
    MessageBundleValidationError {
        bundle: String,
        mismatching_messages: Vec<(String, String, Vec<String>)>,
    },
}