pub enum LingoraError {
Io(Error),
TomlParse(Error),
Args(Error),
Fluent(Fluent4rsError),
Syn(Error),
InvalidLocale(String),
InvalidFluentPath(PathBuf),
InvalidRustPath(PathBuf),
AmbiguousLanguageRoots(String),
MissingTranslationFiles(String),
MissingPrimaryLocales(String),
MalformedIdentifierLiteral(String),
}Expand description
Error type for the lingora-core crate.
Variants§
Io(Error)
An I/O error occurred while reading/writing files (Fluent files, config, Rust sources, etc)
TomlParse(Error)
Failed to deserialize Lingora.toml configuration file.
Args(Error)
Clap failed to parse command-line arguments.
Fluent(Fluent4rsError)
Error originating from the fluent4rs parser while parsing .ftl files.
Syn(Error)
syn failed to parse Rust source code (used when scanning for t!, te!, tid! macros).
InvalidLocale(String)
The provided locale string is not a valid BCP 47 language tag.
Example: "french" instead of "fr", or "en_US" (underscore instead of hyphen).
InvalidFluentPath(PathBuf)
A file path was given as a Fluent translation file, but it doesn’t match expected naming conventions or location rules (e.g. wrong extension, not under a locale dir).
InvalidRustPath(PathBuf)
A path was provided as a Rust source file to scan, but it cannot be processed (wrong extension, not readable, outside project root, etc)
AmbiguousLanguageRoots(String)
Multiple locale files resolve to the same primary language root, making it
impossible to determine a clean fallback chain (e.g. two files both treated as “en”).
This usually indicates misconfiguration in Lingora.toml or ambiguous file naming.
MissingTranslationFiles(String)
The configuration or CLI arguments require translation files for certain locales, but none were found on disk.
MissingPrimaryLocales(String)
The workspace or configuration specifies locales, but none of them qualify as primary locales (i.e. no non-variant/base-language documents were located).
MalformedIdentifierLiteral(String)
A string literal found in Rust code (inside a t!, te! or tid! macro)
does not conform to the expected Fluent identifier syntax.
Examples of malformed literals:
- contains invalid characters
- starts with a digit
- has invalid dot/hyphen placement
Trait Implementations§
Source§impl Debug for LingoraError
impl Debug for LingoraError
Source§impl Display for LingoraError
impl Display for LingoraError
Source§impl Error for LingoraError
impl Error for LingoraError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for LingoraError
impl From<Error> for LingoraError
Source§impl From<Error> for LingoraError
impl From<Error> for LingoraError
Source§impl From<Error> for LingoraError
impl From<Error> for LingoraError
Source§impl From<Error> for LingoraError
impl From<Error> for LingoraError
Source§impl From<Fluent4rsError> for LingoraError
impl From<Fluent4rsError> for LingoraError
Source§fn from(source: Fluent4rsError) -> Self
fn from(source: Fluent4rsError) -> Self
Auto Trait Implementations§
impl Freeze for LingoraError
impl !RefUnwindSafe for LingoraError
impl Send for LingoraError
impl Sync for LingoraError
impl Unpin for LingoraError
impl UnsafeUnpin for LingoraError
impl !UnwindSafe for LingoraError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.