refactor: tighten captcha poll loop and document solver funcs

This commit is contained in:
2026-04-12 01:10:20 +04:00
parent 006029aad1
commit 1bd58a02b7
2 changed files with 151 additions and 20 deletions

View File

@@ -445,7 +445,13 @@ func (e ScriptUnknownEngineError) Error() string {
// ======================================== Captcha ========================================
var ErrCaptchaKeyEmpty = errors.New("captcha API key cannot be empty")
var (
ErrCaptchaKeyEmpty = errors.New("captcha API key cannot be empty")
// ErrCaptchaProcessing is an internal sentinel returned by the captcha solver polling
// code to signal that a task is not yet solved and polling should continue.
// It should never be surfaced to callers outside of the captcha poll loop.
ErrCaptchaProcessing = errors.New("captcha task still processing")
)
type CaptchaAPIError struct {
Endpoint string