use thiserror::Error;
use crate::KeyError;
#[derive(Debug, Error)]
pub enum MessageDecodeError {
#[error("The message doesn't contain enough bytes to be decoded")]
MessageIncomplete,
#[error("The embedded ephemeral Curve25519 key could not have been decoded: {0:?}")]
KeyError(#[from] KeyError),
#[error("The ciphertext could not have been decoded from a base64 string: {0:?}")]
Base64(#[from] base64::DecodeError),
}
#[derive(Debug, Error)]
pub enum Error {
#[error("Failed decrypting the message")]
Decryption,
#[error("Failed decrypting the message")]
Encapsulation(#[from] hpke::HpkeError),
}