#[non_exhaustive]pub enum Error {
Api(ApiError),
Transport(Error),
Timeout(Duration),
RunFailed {
run: SmartBrowseRun,
},
WaitTimeout {
last: SmartBrowseRun,
},
Config(String),
Decode(String),
}Expand description
Top-level error returned by every SDK method.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Api(ApiError)
The server returned a structured API error envelope (or a bare-401 body).
Transport(Error)
A network/transport failure that is not a timeout (connection reset, DNS, body-read failure, TLS, …).
Timeout(Duration)
The request exceeded the configured per-request timeout.
RunFailed
A SmartBrowse run reached a terminal failed/cancelled state while
waiting. Carries the full run so error, pages_extracted, and
credits_used are inspectable.
Fields
run: SmartBrowseRunThe terminal run.
WaitTimeout
SmartBrowse::wait_for_run exceeded
its deadline before the run finished. Carries the last-seen run.
Fields
last: SmartBrowseRunThe most recent run state observed before the deadline.
Config(String)
Client construction failed (e.g. missing API key, bad HTTP client).
Decode(String)
A well-formed HTTP response could not be decoded into the expected shape.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_code(&self, code: &ErrorCode) -> bool
pub fn is_code(&self, code: &ErrorCode) -> bool
True when this is an API error with the given ErrorCode.
True for unauthorized API errors (both envelope and bare-401 shapes).
Sourcepub fn is_insufficient_credits(&self) -> bool
pub fn is_insufficient_credits(&self) -> bool
True for insufficient_credits API errors.
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
True for rate_limited API errors.
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
True for not_found API errors.
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()