Enum libmcaptcha::errors::CaptchaError
source · pub enum CaptchaError {
Show 19 variants
LevelEmpty,
DifficultyFactorZero,
CaptchaDurationZero,
SetDifficultyFactor,
SetVisitorThreshold,
DuplicateVisitorCount,
DecreaseingDifficultyFactor,
MailboxError,
InsuffiencientDifficulty,
StringNotFound,
MCaptchaKeyValidationFail,
InvalidPoW,
PleaseSetValue(String),
RedisError(RedisError),
RecvError(RecvError),
MCaptchaRedisModuleError,
MCaptchaRedisModuleIsNotLoaded,
MCaptchaRediSModuleCommandNotFound(String),
QueueFull,
}
Expand description
Error datatype
Variants§
LevelEmpty
When configuring libmcaptcha, DefenseBuilder
must be passed atleast one LevelConfig
if not this error will arise
DifficultyFactorZero
Visitor count must be a whole number(zero and above). When configuring libmcaptcha, LevelBuilder. difficulty_factor must be set to greater than zero.
CaptchaDurationZero
captcha cooldown duration must be greater than 0
SetDifficultyFactor
Difficulty factor must be set
SetVisitorThreshold
Visitor threshold must be set
DuplicateVisitorCount
Visitor count must be Unique
DecreaseingDifficultyFactor
Difficulty factor should increase with level
MailboxError
Difficulty factor should increase with level
InsuffiencientDifficulty
Happens when submitted work doesn’t satisfy the required difficulty factor
StringNotFound
Happens when submitted work is computed over string that isn’t in cache
MCaptchaKeyValidationFail
Happens when submitted work is computed over configuration intended for a different mCAptcha sitekey
InvalidPoW
Submitted PoW is invalid
PleaseSetValue(String)
Used in builder structs when a value is not set
RedisError(RedisError)
RedisError
RecvError(RecvError)
Channel receive error
MCaptchaRedisModuleError
Weird behaviour from mcaptcha redis module
MCaptchaRedisModuleIsNotLoaded
When libmcaptcha is ordered to connect to a Redis instance that doesn’t have mCaptcha Redis module loaded
MCaptchaRediSModuleCommandNotFound(String)
MCaptcha redis module is loaded but it doesn’t have the necessary Redis commands. Usually a version mismatch
QueueFull
IP Queue is full
Trait Implementations§
source§impl Debug for CaptchaError
impl Debug for CaptchaError
source§impl Display for CaptchaError
impl Display for CaptchaError
source§impl Error for CaptchaError
impl Error for CaptchaError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<MailboxError> for CaptchaError
impl From<MailboxError> for CaptchaError
source§impl From<RecvError> for CaptchaError
impl From<RecvError> for CaptchaError
source§impl From<RedisError> for CaptchaError
impl From<RedisError> for CaptchaError
source§impl PartialEq<CaptchaError> for CaptchaError
impl PartialEq<CaptchaError> for CaptchaError
source§fn eq(&self, other: &CaptchaError) -> bool
fn eq(&self, other: &CaptchaError) -> bool
self
and other
values to be equal, and is used
by ==
.