use thiserror::Error;
use crate::http::HttpResolverError;
#[derive(Debug, Error)]
pub enum TimeStampError {
#[error("time stamp has an expired certificate")]
ExpiredCertificate,
#[error("time stamp does not match data")]
InvalidData,
#[error("time stamp contains an unsupported algorithm")]
UnsupportedAlgorithm,
#[error("time stamp authority is untrusted")]
Untrusted,
#[error("decode error ({0})")]
DecodeError(String),
#[error(transparent)]
IoError(#[from] std::io::Error),
#[error("nonce mismatch")]
NonceMismatch,
#[error("service responded with an HTTP error (status = {0}, content-type = {1:?})")]
HttpErrorResponse(u16, Option<String>),
#[error("unable to complete HTTP request ({0})")]
HttpConnectionError(String),
#[error("internal error ({0})")]
InternalError(String),
#[error(transparent)]
HttpResolverError(#[from] HttpResolverError),
}