aeat.adapters.outbound.aeat.browser._errors module¶
Shared exception types for AEAT browser adapters.
The browser adapter wraps Playwright launch, context creation, evasion,
navigation, site-health, and teardown failures in BrowserError with a
stable BrowserFailureMode. That mode is copied into the structured
context mapping so CLI and workflow error renderers can classify failures
without parsing message text.
See also
adapters.outbound.aeat.browser.BrowserSessionCentral owner that emits these browser errors.
adapters.outbound.aeat.browser.EvasionStrategyStrategy hook whose setup failures surface as
BrowserEvasionError.adapters.outbound.aeat.browser.SiteHealthStatusSite-health record carried separately by
core.errors.SiteHealthErrorwhen AEAT itself returns a classified non-OK response.
- exception BrowserError(message=None, *, failure_mode=None, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorBase class for browser-related failures.
failure_modemay be aBrowserFailureModemember or an existing string value. When supplied, it is stored both onself.failure_modeand undercontext["failure_mode"]so downstream callers can branch on one stable tag.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception BrowserValidationError(message=None, *, failure_mode=None, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
BrowserError,ValueErrorRaised when browser parameters or field values fail domain validation.
This error inherits from both
BrowserErrorandValueError, ensuring compatibility with Pydantic’s validator contract while remaining catchable under the package’s unified error hierarchy.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception BrowserEvasionError(message=None, *, failure_mode=None, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
BrowserErrorRaised when browser evasion setup cannot be applied.
PlaywrightStealthEvasionraises this whenplaywright-stealthis unavailable. Failures that occur whileBrowserSessionapplies any strategy are wrapped withBrowserFailureMode.EVASION_FAILED.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- class BrowserFailureMode(*values)[source]¶
Bases:
StrEnumClosed browser-backend failure modes emitted by the central session.
BrowserSessionuses these values for one-live-context enforcement, browser launch, context creation, evasion, provider annotation, page-content reads, navigation transport failures, site-health classifications, and retained browser close failures.- SESSION_BUSY¶
- BROWSER_LAUNCH_FAILED¶
- CONTEXT_CREATE_FAILED¶
- EVASION_FAILED¶
- CONTEXT_ANNOTATION_FAILED¶
- PAGE_CONTENT_FAILED¶
- NAVIGATION_TIMEOUT¶
- NAVIGATION_TRANSPORT_ERROR¶
- SITE_HEALTH_NON_OK¶
- BROWSER_CLOSE_FAILED¶