diff --git a/.gitignore b/.gitignore index 2eea0d3..20b656e 100755 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ evercrypt_provider/target rust_crypto_provider/target traits/target/ .DS_Store +/.idea diff --git a/src/lib.rs b/src/lib.rs index 23ad40a..2ecc24d 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,6 +84,14 @@ pub enum HpkeError { LockPoisoned, } +impl std::error::Error for HpkeError {} + +impl std::fmt::Display for HpkeError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "HPKE Error: {:?}", self) + } +} + #[deprecated( since = "0.0.7", note = "Please use HpkePublicKey instead. This alias will be removed with the first stable 0.1 release."