es_fluent_sc_parser/
error.rs

1use std::path::PathBuf;
2use thiserror::Error;
3
4#[derive(Debug, Error)]
5pub enum FluentScParserError {
6    /// An IO error.
7    #[error("IO error accessing path '{0}': {1}")]
8    Io(PathBuf, #[source] std::io::Error),
9
10    /// An error that occurs when parsing a Rust file.
11    #[error("Failed to parse Rust file '{0}': {1}")]
12    Syn(PathBuf, #[source] syn::Error),
13
14    /// An error that occurs when walking a directory.
15    #[error("Error walking directory '{0}': {1}")]
16    WalkDir(PathBuf, #[source] walkdir::Error),
17
18    /// An error that occurs when parsing an attribute.
19    #[error("Attribute parsing error in file '{0}': {1}")]
20    AttributeParse(PathBuf, #[source] darling::Error),
21
22    /// An error that occurs when a required attribute is missing.
23    #[error("Missing required attribute data in file '{0}': {1}")]
24    MissingAttribute(PathBuf, String),
25
26    /// An internal logic error.
27    #[error("Internal logic error: {0}")]
28    Internal(String),
29}