citadel_frontend/util/errors.rs
1//! Errors that can be returned by the frontend.
2
3use std::{error::Error, fmt::Display};
4
5#[derive(Debug)]
6pub struct InvalidLiteral(pub String);
7
8impl Error for InvalidLiteral {}
9
10impl Display for InvalidLiteral {
11 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12 f.write_str(format!("The provided literal \"{}\" is invalid", self.0).as_str())
13 }
14}