attenuable_jwt/sign/
error.rs

1use thiserror::Error;
2
3/// An error that may occur during attenuable JWT signing.
4#[derive(Debug, Error)]
5pub enum Error {
6    /// An error related to creating a JWT.
7    #[error("jwt error")]
8    JWTError(Option<Box<dyn std::error::Error>>),
9    /// An error creating or converting a public or private key.
10    #[error("key error")]
11    KeyError(Option<Box<dyn std::error::Error>>),
12    /// An error arising from cryptographic operations.
13    #[error("crypto error")]
14    CryptoError,
15    /// An error indicating invalid serialization.
16    #[error("serialization error")]
17    SerializationError(Box<dyn std::error::Error>),
18}
19
20/// Result type for signing operations.
21pub type Result<R> = std::result::Result<R, Error>;