-
I'm running my lambda as part of an AWS Step Function and need to handle retry logic by returning async fn show_objects(client: &Client, bucket: &str) -> Result<(), lambda_runtime::Error> {
let resp = client.list_objects_v2().bucket(bucket).send().await?; // returns result with `aws_sdk_s3::Error`
for object in resp.contents().unwrap_or_default() {
println!("{}", object.key().unwrap_or_default());
}
Ok(())
} So which error type should I return and how can I instantiate an |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
ah, it appears the Error types are both just .map_err(|e| {
let backToLambdaError: Error = String::from("error message").into();
backToLambdaError
}); |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
ah, it appears the Error types are both just
Box<dyn Error>
, silly me. You can simply do: