google_places_api/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use thiserror::Error;
use reqwest::Error as ReqwestError;
use serde_json::Error as SerdeError;
use std::io::Error as IOError;

#[derive(Debug, Error)]
pub enum GooglePlacesError {
    #[error("API request failed: {0}")]
    ApiError(String),
    #[error("HTTP error: {0}")]
    HttpError(ReqwestError),    
    #[error("Invalid API key")]
    InvalidApiKey,
    #[error("Parse Error: {0}")]
    ParseError(SerdeError),
    #[error("IO Error")]
    ReaderError(IOError),
    #[error("Invalid Input Parameter: {0}")]
    ParamError(String),
    #[error("Rate Limit Error")]
    RateLimitError,
    // Add more custom error variants as needed
}