pub(crate) fn check_error(&self) -> Result<(), HcaptchaError> {
        if !self.success() {
            match &self.error_codes {
                Some(codes) => Err(HcaptchaError::Codes(codes.clone())),
                None => {
                    let mut codes = HashSet::new();
                    codes.insert(Code::Unknown("No error codes returned".to_owned()));
                    Err(HcaptchaError::Codes(codes))
                }
            }
        } else {
            Ok(())
        }
    }
/// Check success of API call and return HcaptchaError
/// with the error codes if not successful.
Check success of API call and return HcaptchaError
with the error codes if not successful.
Check success of API call and return HcaptchaError with the error codes if not successful .
pub(crate) fn check_error(&self) -> Result<(), HcaptchaError> {
        if !self.success() {
            match &self.error_codes {
                Some(codes) => Err(HcaptchaError::Codes(codes.clone())),
                None => {
                    let mut codes = HashSet::new();
                    codes.insert(Code::Unknown("No error codes returned".to_owned()));
                    Err(HcaptchaError::Codes(codes))
                }
            }
        } else {
            Ok(())
        }
    }
pub ( crate ) fn check_error ( & self ) -> Result < ( ) , HcaptchaError > { if ! self . success ( ) { match & self . error_codes { Some ( codes ) => Err ( HcaptchaError :: Codes ( codes . clone ( ) ) ) , None => { let mut codes = HashSet :: new ( ) ; codes . insert ( Code :: Unknown ( " " . to_owned ( ) ) ) ; Err ( HcaptchaError :: Codes ( codes ) ) } } } else { Ok ( ( ) ) } }
Check success of API call and return HcaptchaError
with the error codes if not successful.
Check success of API call and return HcaptchaError with the error codes if not successful .
&self
&self