#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("wire encoding error: {0}")]
Wire(scroll::Error),
#[error("cryptographic error")]
Crypto,
#[error("error converting slice to array: {0}")]
TryFromSlice(#[from] core::array::TryFromSliceError),
#[error("unexpected message code: {0}")]
UnexpectedMessage(u8),
}
impl From<scroll::Error> for Error {
fn from(err: scroll::Error) -> Self {
Error::Wire(err)
}
}
impl From<aws_lc_rs::error::Unspecified> for Error {
fn from(_err: aws_lc_rs::error::Unspecified) -> Self {
Error::Crypto
}
}