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.

@mattscamp mattscamp requested a review from a team August 9, 2023 19:33
@ahmed-mez ahmed-mez added the apm:ecosystem contrib/* related feature requests or bugs label Aug 17, 2023
@mattscamp
Copy link
Contributor Author

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

@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

@rarguelloF rarguelloF changed the title contrib/echo: add WithCustomErrorFunc Option contrib/labstack/echo.v4: add WithCustomErrorFunc Option Aug 31, 2023
zarirhamza

This comment was marked as outdated.

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.

contrib/labstack/echo.v4/echotrace.go Outdated Show resolved Hide resolved
contrib/labstack/echo.v4/echotrace_test.go Outdated Show resolved Hide resolved
contrib/labstack/echo.v4/echotrace_test.go Outdated Show resolved Hide resolved
contrib/labstack/echo.v4/option.go Outdated Show resolved Hide resolved
contrib/labstack/echo.v4/option.go Outdated Show resolved Hide resolved
contrib/labstack/echo.v4/option.go Outdated Show resolved Hide resolved
contrib/labstack/echo.v4/option.go Outdated Show resolved Hide resolved
contrib/labstack/echo.v4/option.go Outdated Show resolved Hide resolved
@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

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!!

@rarguelloF rarguelloF merged commit c487104 into DataDog:main Sep 7, 2023
10 checks passed
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