Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

feat: override status code with thrown error message #592

Merged
merged 3 commits into from
Jun 8, 2022

Conversation

ronnathaniel
Copy link
Contributor

No description provided.

Verified

This commit was signed with the committer’s verified signature.
gaborbernat Bernát Gábor
@ronnathaniel ronnathaniel requested a review from a team as a code owner June 7, 2022 03:37
@ronnathaniel ronnathaniel requested a review from osherv June 7, 2022 03:37
nemoshlag
nemoshlag previously approved these changes Jun 7, 2022
@@ -178,7 +178,13 @@ function baseLambdaWrapper(
message: errorMessage,
};
}

// Attempt to extract Status Code from err message.
const parsedErrMessage = utils.parseRelaxedJSON(reportedError.message);
Copy link

@ivojinovic ivojinovic Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey I'm sorry, I think I mislead you with what I wrote in the email: not all of our error messages are stringifyed JSON with statusCode - in fact a lot of them are just a string containing 400 or 500. So, I think it would be best if this worked exactly like the mapping in or APIGW IntegrationResponses: by searching the string for a pattern like this .*50[0-9].* or .*40[0-9].*. Ideally, it would be able to capture the exact code (such as 403, or 502 if need be), because sometimes the mappings look for those specific codes and we may want in our traces exactly what the FE will receive

Verified

This commit was signed with the committer’s verified signature.
gaborbernat Bernát Gábor

Verified

This commit was signed with the committer’s verified signature.
gaborbernat Bernát Gábor
@ronnathaniel ronnathaniel changed the title feat: parse relaxed json and extracted from message feat: override status code with thrown error message Jun 7, 2022
@nemoshlag nemoshlag merged commit 6480b8c into master Jun 8, 2022
@nemoshlag
Copy link
Member

🎉 This PR is included in version 1.123.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants