Public declaration syntax from forge-rs/crates/forge-provider-google/src/error.rs Original source SHA-256: 66c5937121962fe1497d4cd193fbf5f216225a5ef03c2fc5eaf5f652099eaadf Function bodies and constant values are omitted. This is not the complete implementation. Source line 32 #[derive(Debug, Error)] pub enum GoogleError { /// The API key was not provided in the configuration. #[error("Google API key is missing: provide it via GoogleConfig::builder(api_key) or the GOOGLE_API_KEY environment variable")] MissingApiKey, /// The model identifier is empty or invalid. #[error("invalid model identifier '{model_id}': model ID must be a non-empty string (e.g., 'gemini-2.5-pro', 'gemini-2.5-flash')")] InvalidModelId { /// The invalid model identifier that was provided. model_id: String, }, /// An HTTP request to the Gemini API failed. #[error("HTTP request to Google Gemini API failed: {reason} (url: {url})")] HttpError { /// The URL that was being requested. url: String, /// A description of the failure. reason: String, }, /// The Gemini API returned a non-success HTTP status code. #[error("Google Gemini API returned HTTP {status_code}: {body} (model: {model})")] ApiError { /// The HTTP status code returned. status_code: u16, /// The response body (may contain error details from Google). body: String, /// The model that was being called. model: String, }, /// The Gemini API response could not be deserialized. #[error("failed to deserialize Google Gemini API response: {reason} (raw: {raw_body})")] DeserializationError { /// A description of what was expected. reason: String, /// The raw response body that failed to parse (truncated to 500 chars). raw_body: String, }, /// The Gemini API response contained no candidates. #[error("Google Gemini API returned no candidates for model '{model}': the response was empty or all candidates were filtered")] EmptyResponse { /// The model that was called. model: String, }, /// An SSE stream event could not be parsed. #[error("failed to parse SSE stream event: {reason}")] SseParseError { /// A description of what went wrong. reason: String, }, /// A request timed out. #[error("request to Google Gemini API timed out after {timeout_seconds}s (model: {model})")] Timeout { /// The timeout duration in seconds. timeout_seconds: u64, /// The model that was being called. model: String, }, /// Message translation failed. #[error("failed to translate message to Gemini format: {reason}")] MessageTranslationError { /// A description of what went wrong. reason: String, }, /// The Gemini API indicated content was blocked by safety filters. #[error("Google Gemini API blocked content for model '{model}': safety filter triggered (finish_reason: SAFETY)")] SafetyBlocked { /// The model that was called. model: String, }, }