1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// Error type that extensions may result in
pub type Error = lambda_runtime_api_client::Error;

/// Simple error that encapsulates human readable descriptions
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExtensionError {
    err: String,
}

impl ExtensionError {
    pub(crate) fn boxed<T: Into<String>>(str: T) -> Box<ExtensionError> {
        Box::new(ExtensionError { err: str.into() })
    }
}

impl std::fmt::Display for ExtensionError {
    #[inline]
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        self.err.fmt(f)
    }
}

impl std::error::Error for ExtensionError {}