use thiserror::Error;
#[derive(Debug, Error)]
pub enum E2eError {
#[error("DH value outside valid range")]
DhValidationFailed,
#[error("computed shared secret is invalid")]
SharedSecretInvalid,
#[error("key fingerprint mismatch")]
KeyFingerprintMismatch,
#[error("decryption failed")]
DecryptionFailed,
#[error("encryption failed")]
EncryptionFailed,
#[error("chat not found: {0}")]
ChatNotFound(i32),
#[error("chat already exists: {0}")]
ChatAlreadyExists(i32),
#[error("invalid state: {0}")]
InvalidState(String),
#[error("message too large")]
MessageTooLarge,
#[error("re-key already in progress")]
RekeyInProgress,
#[error("TL serialization failed")]
TlSerializationFailed,
#[error("TL deserialization failed")]
TlDeserializationFailed,
#[error("security error: {0}")]
SecurityError(String),
#[error("transport: {0}")]
Transport(String),
#[error("file upload failed: {0}")]
UploadFailed(String),
#[error("file too large (max 2 GB)")]
FileTooLarge,
}