1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum LangError {
6 #[error("failed to read translation file: {0}")]
8 IoError(#[from] std::io::Error),
9
10 #[error("failed to parse translation JSON: {0}")]
12 JsonError(#[from] serde_json::Error),
13
14 #[error("no translations loaded from the given path")]
16 NoTranslationsLoaded,
17
18 #[error("invalid locale: {locale}")]
20 InvalidLocale {
21 locale: String,
23 },
24
25 #[error("lang config error: {message}")]
27 ConfigError {
28 message: String,
30 },
31}