1use std::error::Error;
2use std::fmt::{self, Display};
3
4#[derive(Debug, PartialEq)]
5pub enum ParserError {
6 InvalidLanguage,
7 InvalidSubtag,
8}
9
10impl Error for ParserError {}
11
12impl Display for ParserError {
13 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
14 let value: &str = match self {
15 ParserError::InvalidLanguage => "The given language subtag is invalid",
16 ParserError::InvalidSubtag => "Invalid subtag",
17 };
18 f.write_str(data:value)
19 }
20}
21