Public declaration syntax from forge-rs/crates/forge-search/src/error.rs Original source SHA-256: b783a82cb5a034464420fcd3225d01665f1db3cb724715d7a18e950caa09664e Function bodies and constant values are omitted. This is not the complete implementation. Source line 22 #[derive(Debug, Error)] pub enum SearchError { /// The search query was empty or blank. #[error("search query must not be empty; provide a non-blank query string")] EmptyQuery, /// The OneSearch API endpoint is not configured or unreachable. #[error( "OneSearch API endpoint '{endpoint}' is not reachable: {reason}; \ verify the endpoint URL and that the OneSearch service is running" )] EndpointUnreachable { /// The endpoint URL that was attempted. endpoint: String, /// The reason the endpoint could not be reached. reason: String, }, /// The OneSearch API returned an error response. #[error( "OneSearch API error (HTTP {status}): {message}; \ request_id={request_id}" )] ApiError { /// The HTTP status code returned. status: u16, /// The error message from the API. message: String, /// The request ID for correlation. request_id: String, }, /// A URL provided for extraction or crawling was invalid. #[error("invalid URL '{url}': {reason}")] InvalidUrl { /// The invalid URL. url: String, /// Why the URL is invalid. reason: String, }, /// Too many URLs provided for extraction. #[error( "too many URLs for extraction: {count} provided but maximum is {max}; \ reduce the number of URLs per request" )] TooManyUrls { /// The number of URLs provided. count: usize, /// The maximum allowed. max: usize, }, /// The crawl depth or breadth exceeded configured limits. #[error("crawl parameter out of range: {param}={value} but allowed range is [{min}, {max}]")] CrawlParameterOutOfRange { /// The parameter name (e.g., "max_depth", "max_breadth"). param: String, /// The value that was provided. value: i64, /// The minimum allowed value. min: i64, /// The maximum allowed value. max: i64, }, /// Request timed out. #[error("search request timed out after {timeout_ms}ms")] Timeout { /// The timeout in milliseconds. timeout_ms: u64, }, /// Serialization or deserialization of request/response failed. #[error("serialization error: {reason}")] SerializationError { /// What went wrong. reason: String, }, /// Search is disabled or not configured in this toolbelt instance. #[error( "search tool '{tool_name}' is not configured; set the OneSearch endpoint in \ SearchConfig or provide an API key to enable search capabilities" )] NotConfigured { /// The tool name that was invoked. tool_name: String, }, } Source line 113 pub type SearchResult = Result;