lambda_extension/
error.rs

1/// Error type that extensions may result in
2pub type Error = lambda_runtime_api_client::BoxError;
3
4/// Simple error that encapsulates human readable descriptions
5#[derive(Clone, Debug, PartialEq, Eq)]
6pub struct ExtensionError {
7    err: String,
8}
9
10impl ExtensionError {
11    pub(crate) fn boxed<T: Into<String>>(str: T) -> Box<ExtensionError> {
12        Box::new(ExtensionError { err: str.into() })
13    }
14}
15
16impl std::fmt::Display for ExtensionError {
17    #[inline]
18    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19        self.err.fmt(f)
20    }
21}
22
23impl std::error::Error for ExtensionError {}