Spaces:
Sleeping
Sleeping
Download apps/rust-sdk/src/error.rs from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/rust-sdk/src/error.rs
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/rust-sdk/src/error.rs
-
curl -L -o error.rs https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/rust-sdk/src/error.rs
1.32 kB
| use std::fmt::Display; | |
| use serde::{Deserialize, Serialize}; | |
| use serde_json::Value; | |
| use thiserror::Error; | |
| pub struct FirecrawlAPIError { | |
| /// Always false. | |
| pub success: bool, | |
| /// Error message | |
| pub error: String, | |
| /// Additional details of this error. Schema depends on the error itself. | |
| pub details: Option<Value>, | |
| } | |
| impl Display for FirecrawlAPIError { | |
| fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | |
| if let Some(details) = self.details.as_ref() { | |
| write!(f, "{} ({})", self.error, details) | |
| } else { | |
| write!(f, "{}", self.error) | |
| } | |
| } | |
| } | |
| pub enum FirecrawlError { | |
| HttpRequestFailed(String, u16, String), | |
| HttpError(String, reqwest::Error), | |
| ResponseParseErrorText(reqwest::Error), | |
| ResponseParseError(serde_json::Error), | |
| APIError(String, FirecrawlAPIError), | |
| JobFailed(String, crate::types::JobStatus), | |
| Misuse(String), | |
| } | |