Skip to content

Support for overriding ErrorHandler in httputil.ReverseProxy #1234

@kayvonkhosrowpour

Description

@kayvonkhosrowpour

What would you like?

Motivation
I am using the https://pkg.go.dev/github.com/go-kit/kit/transport/httprp package for a reverse proxy. If the client disconnects or the connection is dropped, an error is produced in our logs:

http: proxy error: context canceled

Digging into the go-kit source code, the httputil.ReverseProxy is created but it's not possible to set the ErrorHandler function, which is responsible for logging the above error message. This clutters our logs and doesn't let us control how errors are handled in our application.

See more here: golang/go#20071

Proposal
To follow along with the ServerOption abstraction, perhaps a new option can be added which can allow users to override the default ErrorHandler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions