armature_lambda/
error.rs

1//! Lambda error types.
2
3use thiserror::Error;
4
5/// Result type for Lambda operations.
6pub type Result<T> = std::result::Result<T, LambdaError>;
7
8/// Lambda runtime errors.
9#[derive(Debug, Error)]
10pub enum LambdaError {
11    /// Application error.
12    #[error("Application error: {0}")]
13    Application(String),
14
15    /// Request conversion error.
16    #[error("Request conversion error: {0}")]
17    Request(String),
18
19    /// Response conversion error.
20    #[error("Response conversion error: {0}")]
21    Response(String),
22
23    /// Configuration error.
24    #[error("Configuration error: {0}")]
25    Config(String),
26
27    /// Lambda runtime error.
28    #[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}