lambda_runtime_api_client/
error.rs1use std::{error::Error as StdError, fmt};
4pub use tower::BoxError;
5#[derive(Debug)]
7pub struct Error {
8 inner: BoxError,
9}
10
11impl Error {
12 pub fn new(error: impl Into<BoxError>) -> Self {
14 Self { inner: error.into() }
15 }
16
17 pub fn into_inner(self) -> BoxError {
19 self.inner
20 }
21}
22
23impl fmt::Display for Error {
24 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
25 self.inner.fmt(f)
26 }
27}
28
29impl StdError for Error {
30 fn source(&self) -> Option<&(dyn StdError + 'static)> {
31 Some(&*self.inner)
32 }
33}