DataDog / datadog-lambda-js

The Datadog AWS Lambda Library for Node
Apache License 2.0
105 stars 35 forks source link

Capture and handle errors during stringify. #544

Closed purple4reina closed 2 months ago

purple4reina commented 2 months ago

What does this PR do?

When the response object contains a circular reference, JSON.stringify will throw an error. This should be caught and ignored.

Motivation

Fixes https://github.com/DataDog/datadog-lambda-js/issues/541

Testing Guidelines

Additional Notes

Types of Changes

Check all that apply

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.03%. Comparing base (78c1900) to head (6b1cf37). Report is 13 commits behind head on main.

:exclamation: Current head 6b1cf37 differs from pull request most recent head 143da60. Consider uploading reports for the commit 143da60 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #544 +/- ## ========================================== + Coverage 81.75% 82.03% +0.28% ========================================== Files 54 56 +2 Lines 2209 2305 +96 Branches 515 533 +18 ========================================== + Hits 1806 1891 +85 - Misses 337 343 +6 - Partials 66 71 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rdsedmundo commented 1 month ago

@purple4reina thanks for handling this.

Is there a timeline for when this would be released as a new layer? It'd be nice to have this bugfix in our side because we are stuck with an old version of the layer due to this.