#[non_exhaustive]pub enum LookupError<'a> {
MissingKey {
key: &'a str,
lang: &'a str,
},
MissingValue {
key: &'a str,
lang: &'a str,
},
Format {
key: &'a str,
lang: &'a str,
errors: FormatErrors<'a>,
},
}Expand description
A localization problem observed at runtime.
Lookups never fail: a missing key renders as the key itself and a broken
placeable renders as best fluent-bundle can. These errors are only
delivered to the handler installed with set_error_handler (and logged
with the optional tracing feature) so QA and telemetry can see them.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingKey
The key resolved in neither the current nor the fallback language, so
the key itself was returned. For a message.attribute key this also
covers a message that exists but lacks that attribute.
Fields
MissingValue
The message exists in lang but has no value (only attributes), so the
bare message ID cannot be rendered; look up message.attribute instead.
The lookup then continues with the fallback language.
Fields
Format
Formatting succeeded only partially, typically because of a missing or mistyped argument. The partially formatted string was still returned.
Trait Implementations§
Source§impl<'a> Clone for LookupError<'a>
impl<'a> Clone for LookupError<'a>
impl<'a> Copy for LookupError<'a>
Source§impl<'a> Debug for LookupError<'a>
impl<'a> Debug for LookupError<'a>
Source§impl Display for LookupError<'_>
impl Display for LookupError<'_>
Source§impl Error for LookupError<'_>
impl Error for LookupError<'_>
1.30.0 · 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()