2020-09-28 21:35:05 +00:00
|
|
|
use thiserror::Error;
|
|
|
|
|
|
|
|
#[derive(Error, Debug)]
|
|
|
|
pub enum BotError {
|
|
|
|
/// Sync token couldn't be found.
|
|
|
|
#[error("the sync token could not be retrieved")]
|
|
|
|
SyncTokenRequired,
|
|
|
|
|
2020-10-03 20:31:42 +00:00
|
|
|
#[error("the message should not be processed because it failed validation")]
|
|
|
|
ShouldNotProcessError,
|
|
|
|
|
2020-09-28 21:35:05 +00:00
|
|
|
#[error("no cache directory found")]
|
|
|
|
NoCacheDirectoryError,
|
|
|
|
|
|
|
|
#[error("could not parse URL")]
|
|
|
|
UrlParseError(#[from] url::ParseError),
|
|
|
|
|
|
|
|
#[error("uncategorized matrix SDK error")]
|
|
|
|
MatrixError(#[from] matrix_sdk::Error),
|
|
|
|
|
|
|
|
#[error("uncategorized matrix SDK base error")]
|
|
|
|
MatrixBaseError(#[from] matrix_sdk::BaseError),
|
|
|
|
|
|
|
|
#[error("future canceled")]
|
|
|
|
FutureCanceledError,
|
|
|
|
|
|
|
|
#[error("tokio task join error")]
|
|
|
|
TokioTaskJoinError(#[from] tokio::task::JoinError),
|
|
|
|
|
|
|
|
//de = deserialization
|
|
|
|
#[error("toml parsing error")]
|
|
|
|
TomlParsingError(#[from] toml::de::Error),
|
|
|
|
|
|
|
|
#[error("i/o error")]
|
|
|
|
IoError(#[from] std::io::Error),
|
2020-10-04 21:32:50 +00:00
|
|
|
|
|
|
|
#[error("parsing error")]
|
|
|
|
ParserError(#[from] combine::error::StringStreamError),
|
|
|
|
|
|
|
|
#[error("dice parsing error")]
|
|
|
|
DiceParsingError(#[from] crate::cofd::parser::DiceParsingError),
|
|
|
|
|
|
|
|
#[error("legacy parsing error")]
|
|
|
|
NomParserError(nom::error::ErrorKind),
|
|
|
|
|
|
|
|
#[error("legacy parsing error: not enough data")]
|
|
|
|
NomParserIncomplete,
|
|
|
|
|
|
|
|
#[error("variables not yet supported")]
|
|
|
|
VariablesNotSupported,
|
2020-09-28 21:35:05 +00:00
|
|
|
}
|