1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, LambdaError>;
7
8#[derive(Debug, Error)]
10pub enum LambdaError {
11 #[error("Application error: {0}")]
13 Application(String),
14
15 #[error("Request conversion error: {0}")]
17 Request(String),
18
19 #[error("Response conversion error: {0}")]
21 Response(String),
22
23 #[error("Configuration error: {0}")]
25 Config(String),
26
27 #[error("Lambda runtime error: {0}")]
29 Runtime(String),
30}
31
32impl From<lambda_runtime::Error> for LambdaError {
33 fn from(err: lambda_runtime::Error) -> Self {
34 Self::Runtime(err.to_string())
35 }
36}