#[non_exhaustive]pub enum Error {
AgentNotStarted,
BackendError {
message: String,
},
ConnectionError {
message: String,
},
QuotaExceeded {
retry_after: Duration,
},
ChannelClosed {
message: String,
},
ConnectionClosed {
message: String,
},
Timeout {
duration: Duration,
operation: String,
},
Stream(StreamError),
InvalidConfig {
message: String,
},
Io {
message: String,
kind: ErrorKind,
},
}Expand description
All errors that can occur in the bridge layer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AgentNotStarted
The agent was not started or has been shut down before an operation was requested.
BackendError
An exception was raised in the backend.
ConnectionError
A connection-level error from the Antigravity SDK.
QuotaExceeded
Quota / rate-limit error (HTTP 429 or equivalent).
ChannelClosed
The internal command channel was closed unexpectedly.
ConnectionClosed
Connection was permanently closed.
Timeout
An operation exceeded its configured timeout.
Fields
Stream(StreamError)
An error originating from the streaming response layer.
InvalidConfig
The provided configuration is invalid or self-contradictory.
Io
An I/O error occurred during a file or socket operation.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if this error is potentially transient and the
operation may succeed if retried at a higher level.
Currently retryable:
Error::ConnectionError— network-level failuresError::QuotaExceeded— rate-limited, retry after backoff- Stream errors carrying a retryable HTTP status (429 or any 5xx)
- Backend errors reporting
RESOURCE_EXHAUSTEDor HTTP 503
Sourcepub fn is_quota_error(&self) -> bool
pub fn is_quota_error(&self) -> bool
Returns true if this error indicates a quota / rate-limit condition.
Matches the structured Error::QuotaExceeded variant, stream errors
carrying a quota HTTP status (429 or 503), and backend/stream messages
reporting RESOURCE_EXHAUSTED, HTTP 429, or HTTP 503.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for Error
Converts a Python exception into the most specific Error variant.
impl From<Error> for Error
Converts a Python exception into the most specific Error variant.
Checks for Antigravity SDK errors (connection, validation), Pydantic
validation errors, and Python ImportError before falling back to
Error::BackendError with a formatted traceback.
This impl is always compiled because pyo3 is a mandatory dependency of
the bridge crate — the entire runtime requires it. If you depend on
agy-bridge as a library, pyo3 will be linked transitively.