feat: add CaptchaDecodeError type and retry transient HTTP errors during captcha polling

This commit is contained in:
2026-04-12 22:03:21 +04:00
parent c839b71c9e
commit 8577c771e4
2 changed files with 44 additions and 5 deletions

View File

@@ -520,6 +520,26 @@ func (e CaptchaRequestError) Unwrap() error {
return e.Err
}
type CaptchaDecodeError struct {
Endpoint string
Err error
}
func NewCaptchaDecodeError(endpoint string, err error) CaptchaDecodeError {
if err == nil {
err = errNoError
}
return CaptchaDecodeError{Endpoint: endpoint, Err: err}
}
func (e CaptchaDecodeError) Error() string {
return fmt.Sprintf("captcha %s decode failed: %v", e.Endpoint, e.Err)
}
func (e CaptchaDecodeError) Unwrap() error {
return e.Err
}
type CaptchaPollTimeoutError struct {
TaskID string
}