crypteia icon indicating copy to clipboard operation
crypteia copied to clipboard

Improve logging

Open 1oglop1 opened this issue 1 year ago • 1 comments

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"
}

1oglop1 avatar Aug 14 '23 16:08 1oglop1

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.

metaskills avatar Aug 14 '23 16:08 metaskills

Merged into https://github.com/rails-lambda/crypteia/pull/49

jeremiahlukus avatar Jun 18 '24 19:06 jeremiahlukus