language/
error.rs

1#![allow(missing_docs)]
2
3pub type Result<T, E = Error> = std::result::Result<T, E>;
4
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7	/// Parsing an ICU locale failed.
8	#[cfg(feature = "icu_locale_core")]
9	#[error("Failed to parse ICU locale: {0}")]
10	IcuLocaleParse(#[from] icu_locale_core::ParseError),
11	/// The ICU locale is not mapped to this crate's `Language`.
12	#[cfg(feature = "icu_locale_core")]
13	#[error("Unsupported ICU locale `{0}`.")]
14	UnsupportedIcuLocale(String),
15	/// The base language subtag is not supported by `whatlang`.
16	#[cfg(feature = "whatlang")]
17	#[error("Unsupported whatlang base language subtag `{0}`.")]
18	UnsupportedWhatlangBase(&'static str),
19	/// The `whatlang::Lang` variant is not mapped in this crate.
20	#[cfg(feature = "whatlang")]
21	#[error("Unsupported whatlang Lang variant `{0:?}`.")]
22	UnsupportedWhatlangLang(whatlang::Lang),
23}