pub struct ApiError {
pub status_code: u16,
pub error_type: Option<String>,
pub message: String,
pub attempt: u32,
pub http_method: Option<String>,
pub path: Option<String>,
pub data: Option<Value>,
}Expand description
An error response returned by the Apify API.
This is raised for HTTP requests that reach the API but return a non-success
status code. It mirrors the ApifyApiError of the reference clients and exposes
the parsed error type, the human-readable message, the HTTP status_code,
the number of the final attempt, and the request http_method/path.
Fields§
§status_code: u16HTTP status code of the error response.
error_type: Option<String>The machine-readable error type returned by the API (e.g. record-not-found).
message: StringHuman-readable description of the error returned by the API.
attempt: u32Number of the API call attempt that produced this error (1-based).
http_method: Option<String>HTTP method of the API call (e.g. GET, POST).
path: Option<String>Full path of the API endpoint (URL excluding origin).
data: Option<Value>Additional structured data provided by the API about the error, if any.
Trait Implementations§
Source§impl Error for ApiError
impl Error for ApiError
1.30.0 · 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()