use thiserror::Error;
#[derive(Debug, Clone, PartialEq, Error)]
pub enum ParseError {
#[error("unexpected end of input at position {0}")]
UnexpectedEnd(usize),
#[error("unexpected character '{0}' at position {1}")]
UnexpectedChar(char, usize),
#[error("unclosed stochastic object '{{...'")]
UnclosedStochasticObject,
#[error("invalid bond descriptor at position {0}")]
InvalidBondDescriptor(usize),
#[error("empty SMILES in stochastic fragment")]
EmptySmiles,
#[error("SMILES parse error: {0}")]
SmilesError(String),
}
impl From<opensmiles::ParserError> for ParseError {
fn from(e: opensmiles::ParserError) -> Self {
ParseError::SmilesError(e.to_string())
}
}