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: {0}")]
16    SerializationError(String),
17    /// Network connection error with details
18    #[error("network_error: {0}")]
19    NetworkError(String),
20    /// HTTP request failure
21    #[error(transparent)]
22    Reqwest(#[from] reqwest::Error),
23    /// Unhandled error generating a Zero-Knowledge Proof
24    #[error(transparent)]
25    ProofGeneration(#[from] semaphore_rs::protocol::ProofError),
26    /// The `semaphore` feature flag is not enabled
27    #[error("semaphore_not_enabled")]
28    SemaphoreNotEnabled,
29    /// The requested credential is not issued for this World ID
30    #[error("credential_not_issued")]
31    CredentialNotIssued,
32}