Skip to content

Commit cd89e7d

Browse files
committed
Log error chain to CloudWatch
The anyhow crate will only include the error chain with {:?} or {:#}. Without this change, only the last error will be logged to CloudWatch and all underlying causes are lost when using with_context to augment errors. Fixes awslabs#348
1 parent 089fc03 commit cd89e7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lambda-runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ where
125125
.into_req()
126126
}
127127
Err(err) => {
128-
error!("{}", err); // logs the error in CloudWatch
128+
error!("{:?}", err); // logs the error (chain) to CloudWatch Logs
129129
EventErrorRequest {
130130
request_id,
131131
diagnostic: Diagnostic {

0 commit comments

Comments
 (0)