//! The type that represents all erros in `sfr-core`.

use crate::error::BoxError;

/// The type that represents all erros in `sfr-core`.
#[derive(thiserror::Error, Debug)]
pub enum CoreError {
    /// The error while parsing number.
    #[error("failed parsing: {0}: {1}")]
    ParsingNumber(&'static str, BoxError),

    /// The error represents a failure of verification by HMAC.
    #[error("failed to verify signature")]
    FailedToVerifySignature,

    /// The error represents a mismatch of the Slack App's Verification Tokens.
    #[error("mismatch of verification tokens.")]
    MismatchVerificationTokens,

    /// The error represents that the timestamp in the request is out of range.
    #[error("timestamp expired")]
    TimestampExpired,

    /// The error represents that it failed to initialize the HMAC engine.
    #[error("HMAC cannot initialized")]
    FailedToInitializeHmac(BoxError),
}
