use reqwest::StatusCode; // #[derive(Debug, Error, From)] pub enum DownloadError { #[error("A network error: {0}")] NetworkError(#[source] reqwest::Error), #[error("An I/O error: {0}")] Io(#[source] std::io::Error), } // // #[derive(Debug, Error)] pub enum RequestError { #[error("A Telegram's error #{status_code}: {description}")] ApiError { status_code: StatusCode, description: String, }, /// The group has been migrated to a supergroup with the specified /// identifier. #[error("The group has been migrated to a supergroup with ID #{0}")] MigrateToChatId(i64), /// In case of exceeding flood control, the number of seconds left to wait /// before the request can be repeated #[error("Retry after {0} seconds")] RetryAfter(i32), #[error("A network error: {0}")] NetworkError(#[source] reqwest::Error), #[error("An error while parsing JSON: {0}")] InvalidJson(#[source] serde_json::Error), } //