use crate::core::json;
use error_iter::ErrorIter;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("HTTP error")]
Http(#[from] http::Error),
#[error("Hyper error")]
Hyper(#[from] hyper::Error),
#[error("Invalid UTF-8")]
Utf8(#[from] std::str::Utf8Error),
#[error("Invalid JSON")]
Json(#[from] json::Error),
#[error("Server responded with error")]
Server(String),
#[error("Unexpected response schema")]
UnexpectedResponseSchema(json::JsonValue),
}
impl ErrorIter for Error {}