sal/vault/src/error.rs
Mahmoud-Emad 6dead402a2
Some checks are pending
Rhai Tests / Run Rhai Tests (push) Waiting to run
feat: Remove herodo from monorepo and update dependencies
- Removed the `herodo` binary from the monorepo. This was
  done as part of the monorepo conversion process.
- Updated the `Cargo.toml` file to reflect the removal of
  `herodo` and adjust dependencies accordingly.
- Updated `src/lib.rs` and `src/rhai/mod.rs` to use the new
  `sal-vault` crate for vault functionality.  This improves
  the modularity and maintainability of the project.
2025-06-23 14:56:03 +03:00

54 lines
1.3 KiB
Rust

//! Error types for cryptographic operations
use thiserror::Error;
/// Errors that can occur during cryptographic operations
#[derive(Error, Debug)]
pub enum CryptoError {
/// Invalid key length
#[error("Invalid key length")]
InvalidKeyLength,
/// Encryption failed
#[error("Encryption failed: {0}")]
EncryptionFailed(String),
/// Decryption failed
#[error("Decryption failed: {0}")]
DecryptionFailed(String),
/// Signature format error
#[error("Signature format error: {0}")]
SignatureFormatError(String),
/// Keypair already exists
#[error("Keypair already exists: {0}")]
KeypairAlreadyExists(String),
/// Keypair not found
#[error("Keypair not found: {0}")]
KeypairNotFound(String),
/// No active key space
#[error("No active key space")]
NoActiveSpace,
/// No keypair selected
#[error("No keypair selected")]
NoKeypairSelected,
/// Serialization error
#[error("Serialization error: {0}")]
SerializationError(String),
/// Invalid address format
#[error("Invalid address format: {0}")]
InvalidAddress(String),
/// Smart contract error
#[error("Smart contract error: {0}")]
ContractError(String),
}
// Note: Error conversion to main SAL crate will be handled at the integration level