use miette::Diagnostic;
pub type Result<T=(), E=Error> = std::result::Result<T, E>;
#[derive(thiserror::Error, Debug, Diagnostic)]
#[diagnostic(url(docsrs))]
pub enum Error {
#[error(transparent)]
Utf8(#[from] std::string::FromUtf8Error),
#[error("Unexpected number of bytes remaining after encode")]
EncodeUnexpectedRemainderBytes {},
#[error("Invalid input string length")]
#[diagnostic(help("This error can only occur with padding option `Strict`."))]
DecodeInvalidInputLength {},
#[error("Unexpected number of chars remaining after decode")]
#[diagnostic(help("Ensure your input data is valid base64."))]
DecodeUnexpectedRemainderChars {},
}