ratex_parser/mhchem/error.rs
1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum MhchemError {
5 #[error("mhchem: {0}")]
6 Msg(String),
7 #[error("extra close brace or missing open brace")]
8 ExtraClose,
9}
10
11impl MhchemError {
12 pub fn msg(s: impl Into<String>) -> Self {
13 MhchemError::Msg(s.into())
14 }
15}
16
17pub type MhchemResult<T> = Result<T, MhchemError>;