Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve logging #41

Closed
wants to merge 1 commit into from
Closed

Improve logging #41

wants to merge 1 commit into from

Conversation

1oglop1
Copy link

@1oglop1 1oglop1 commented Aug 14, 2023

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

@metaskills
Copy link
Member

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.

@jeremiahlukus
Copy link
Contributor

Merged into
#49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants