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

contrib/labstack/echo.v4: add WithErrorTranslator Option #2169

Merged
merged 17 commits into from
Sep 7, 2023

Conversation

mattscamp
Copy link
Contributor

@mattscamp mattscamp commented Aug 9, 2023

What does this PR do?

Adds a WithErrorTranslator Option that allows defining a translator of custom errors to the required format.

Motivation

We use a custom error type across our company that cannot be translated to an echo.HTTPError which results in all our status codes set as 500.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
mtoffl01 Mikayla Toffler
@mattscamp mattscamp requested a review from a team August 9, 2023 19:33

Verified

This commit was signed with the committer’s verified signature.
mtoffl01 Mikayla Toffler

Verified

This commit was signed with the committer’s verified signature.
mtoffl01 Mikayla Toffler
@ahmed-mez ahmed-mez added the apm:ecosystem contrib/* related feature requests or bugs label Aug 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@mattscamp
Copy link
Contributor Author

Hey @ahmed-mez , if there is anything I can do to expedite this PR, let me know!

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@ahmed-mez
Copy link
Contributor

Hey @mattscamp - thanks for the contribution! The PR is triaged and the corresponding team will review in the coming days.
cc @rarguelloF

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@mattscamp mattscamp requested a review from djjackson August 29, 2023 17:46

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@rarguelloF rarguelloF changed the title contrib/echo: add WithCustomErrorFunc Option contrib/labstack/echo.v4: add WithCustomErrorFunc Option Aug 31, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
zarirhamza

This comment was marked as outdated.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Contributor

@rarguelloF rarguelloF left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! @mattscamp

After reviewing with @zarirhamza, we just came up with a few minor changes to simplify the code a little bit and make the name of the option a little bit more descriptive. Once these few changes are made, it should be good to go.

@rarguelloF rarguelloF requested a review from zarirhamza August 31, 2023 15:31

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was signed with the committer’s verified signature.
mtoffl01 Mikayla Toffler
@mattscamp
Copy link
Contributor Author

Thanks @rarguelloF @zarirhamza - made those suggested updates!

@mattscamp mattscamp changed the title contrib/labstack/echo.v4: add WithCustomErrorFunc Option contrib/labstack/echo.v4: add WithErrorTranslator Option Sep 5, 2023
Copy link
Contributor

@zarirhamza zarirhamza left a comment

Choose a reason for hiding this comment

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

LGTM

@mattscamp mattscamp requested a review from rarguelloF September 5, 2023 21:28

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was signed with the committer’s verified signature.
mtoffl01 Mikayla Toffler

Verified

This commit was signed with the committer’s verified signature.
mtoffl01 Mikayla Toffler
Copy link
Contributor

@ajgajg1134 ajgajg1134 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks!!

Verified

This commit was signed with the committer’s verified signature.
mtoffl01 Mikayla Toffler
@rarguelloF rarguelloF merged commit c487104 into DataDog:main Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants