walletkit_core/
error.rs

1use thiserror::Error;
2
3/// Error outputs from `WalletKit`
4#[derive(Debug, Error)]
5#[cfg_attr(feature = "ffi", derive(uniffi::Error))]
6#[cfg_attr(feature = "ffi", uniffi(flat_error))]
7pub enum WalletKitError {
8    /// The presented input is not valid for the requested operation
9    #[error("invalid_input")]
10    InvalidInput,
11    /// The presented data is not a valid U256 integer
12    #[error("invalid_number")]
13    InvalidNumber,
14    /// Unexpected error serializing information
15    #[error("serialization_error")]
16    SerializationError,
17    /// HTTP request failure
18    #[error(transparent)]
19    Reqwest(#[from] reqwest::Error),
20    /// Unhandled error generating a Zero-Knowledge Proof
21    #[error(transparent)]
22    ProofGeneration(#[from] semaphore_rs::protocol::ProofError),
23    /// The `semaphore` feature flag is not enabled
24    #[error("semaphore_not_enabled")]
25    SemaphoreNotEnabled,
26}