use clap::builder::StyledStr;
use wda::WdaError;
#[derive(Debug)]
pub enum MafaError {
Buggy,
BugFound(u16),
ClapMatchError(StyledStr),
InvalidTimeoutPageLoad,
InvalidTimeoutScript,
InvalidSocks5Proxy,
InvalidSourceLang,
InvalidTargetLang,
InvalidWords,
InvalidTwitterUsername,
InvalidNumTweets,
InvalidWrapWidth,
WebDrvCmdRejected(String, String),
UnexpectedWda(WdaError),
CacheRebuildFail(CacheRebuildFailKind),
CacheNotBuildable,
AllCachesInvalid,
DataFetchedNotReachable,
UpathNotFound,
UpathLenNotMatched,
UpathValNotMatched,
TweetNotRecoginized(u8),
CamdLevelNotRecoginized(u8),
CacheCorrupted,
MafaDataCacheNotFound,
RequireLogin,
MustGui,
}
#[derive(Debug)]
pub enum CacheRebuildFailKind {
UpathNotFound,
UpathLenNotMatched,
UpathValNotMatched,
UpathLenZero,
}
pub type Result<T> = core::result::Result<T, MafaError>;