crypteia
crypteia copied to clipboard
Improve logging
String representation of errors in AWS SDK is quite terrible at the moment and Err.to_string()
only produces Service error
while hiding all important aspects.
This improvement should display the whole error message
{
"All": "all",
"ErrorMessage": "Error calling ssm:GetParameter. Environment variable: TABLE_NAME Path: x-crypteia-ssm:/sdd-pre-payment-notification/table_name Error: Error { code: Some(\"AccessDeniedException\"), message: Some(\"User: arn:aws:sts::123456789:assumed-role/jan-testing-role/jan-testing-session is not authorized to perform: ssm:GetParameter on resource: arn:aws:ssm:eu-central-1:123456789:parameter/testing-service/table_name because no identity-based policy allows the ssm:GetParameter action\"), request_id: Some(\"69cbdd9d-f7e7-406e-bc81-f5f60ac27c1d\"), extras: {} }",
"_aws": {
"CloudWatchMetrics": [
{
"Dimensions": [
[
"All",
"ssm"
]
],
"Metrics": [
{
"Name": "error",
"Unit": "Count"
}
],
"Namespace": "Crypteia"
}
],
"Timestamp": 1692029912211
},
"error": 1,
"ssm": "ssm"
}
Oh nice change. Looking into why the tests did not run. May have to fix the build system too depending on what errors we have in main.
Merged into https://github.com/rails-lambda/crypteia/pull/49