Skip to main content
All BAP errors follow JSON-RPC 2.0 error format with extended data providing recovery guidance for agents.

Error Response Format

number
required
Numeric error code from the table below.
string
required
Human-readable error message.
boolean
Whether the operation can be retried.
number
Suggested delay before retrying (milliseconds).
object
Additional context (selector used, page ID, etc.).
string
Actionable suggestion for the agent on how to recover from the error.

Error Code Reference

JSON-RPC Standard Errors

Server State Errors

Browser Errors

Element Errors

Security and Approval Errors

Error Handling Patterns

Retry with Backoff

For retryable errors, use the retryAfterMs hint:

Observe-Retry Pattern

The most common recovery pattern for element errors is to re-observe and retry:

Structured Error Classes

Both SDKs provide typed error classes for precise error handling: