use crate::generic::PasetoClaimError;
use thiserror::Error;
#[deprecated(
since = "0.10.0",
note = "Use rusty_paseto::Error instead. This type will be removed in a future major version."
)]
#[derive(Debug, Error)]
pub enum GenericBuilderError {
#[error(transparent)]
ClaimError {
#[from]
source: PasetoClaimError,
},
#[error("{0} is an invalid iso8601 (email) string")]
BadEmailAddress(String),
#[error("The claim '{0}' appears more than once in the top level payload json")]
DuplicateTopLevelPayloadClaim(String),
#[error("A paseto cipher error occurred")]
CipherError {
#[from]
source: crate::core::PasetoError,
},
#[error("The payload was unable to be serialized into json")]
PayloadJsonError {
#[from]
source: serde_json::Error,
},
}