10000 feat: allow customizing http handler error parsing by LucasRoesler · Pull Request #270 · contiamo/go-base · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 12, 2024. It is now read-only.

feat: allow customizing http handler error parsing #270

Merged
merged 2 commits into from
Apr 26, 2022

Conversation

LucasRoesler
Copy link
Member

Expose the default Handler implementation and allow customizing the error parsing by passing a new parser function. This allows overriding the error handling but with a reasonable default.

Additionally, change ValidationErrorsToFiedErrorResponse signature to accept any map[string]error. This is the underlying type for a validation.Error, so it is backwards compatible, but it is also more flexible and will accept more type aliases for validation errors, making it easier to use.

Signed-off-by: Lucas Roesler roesler.lucas@gmail.com

@LucasRoesler LucasRoesler requested a review from megaflo April 26, 2022 07:54
@LucasRoesler LucasRoesler self-assigned this Apr 26, 2022
Expose the default Handler implementation and allow customizing the
error parsing by passing a new parser function. This allows overriding
the error handling but with a reasonable default.

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
@LucasRoesler LucasRoesler force-pushed the feat-allow-customizing-handler-error-parsing branch from c485894 to 8f417a4 Compare April 26, 2022 08:26
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
@LucasRoesler LucasRoesler requested a review from megaflo April 26, 2022 10:57
@LucasRoesler LucasRoesler merged commit 61a10a7 into main Apr 26, 2022
@LucasRoesler LucasRoesler deleted the feat-allow-customizing-handler-error-parsing branch April 26, 2022 11:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0