use thiserror::Error;
pub type Result<T> = std::result::Result<T, LambdaError>;
#[derive(Debug, Error)]
pub enum LambdaError {
#[error("Application error: {0}")]
Application(String),
#[error("Request conversion error: {0}")]
Request(String),
#[error("Response conversion error: {0}")]
Response(String),
#[error("Configuration error: {0}")]
Config(String),
#[error("Lambda runtime error: {0}")]
Runtime(String),
}
impl From<lambda_runtime::Error> for LambdaError {
fn from(err: lambda_runtime::Error) -> Self {
Self::Runtime(err.to_string())
}
}