func WithErrorHandler(f func(error) error) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push(fmt.Sprintf("WithErrorHandler(%+v)", utils.GetFuncName(f)))
		o.ErrHandle = f
	}}
}
WithErrorHandler sets the error handler.
package client
import (
	"fmt"
	"github.com/cloudwego/kitex/internal/client"
	"github.com/cloudwego/kitex/pkg/acl"
	"github.com/cloudwego/kitex/pkg/diagnosis"
	"github.com/cloudwego/kitex/pkg/generic"
	"github.com/cloudwego/kitex/pkg/klog"
	"github.com/cloudwego/kitex/pkg/proxy"
	"github.com/cloudwego/kitex/pkg/remote"
	"github.com/cloudwego/kitex/pkg/remote/trans/netpoll"
	"github.com/cloudwego/kitex/pkg/retry"
	"github.com/cloudwego/kitex/pkg/rpcinfo"
	"github.com/cloudwego/kitex/pkg/utils"
	"github.com/cloudwego/kitex/transport"
)
func WithHTTPConnection() Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push("WithHTTPConnection")
		WithTransHandlerFactory(netpoll.NewHTTPCliTransHandlerFactory()).F(o, di)
	}}
}
func WithClientBasicInfo(ebi *rpcinfo.EndpointBasicInfo) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push(fmt.Sprintf("WithClientBasicInfo(%+v)", ebi))
		if ebi != nil {
			o.Cli = ebi
		}
	}}
}
func WithDiagnosisService(ds diagnosis.Service) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push(fmt.Sprintf("WithDiagnosisService(%+v)", ds))
		o.DebugService = ds
	}}
}
func WithACLRules(rules ...acl.RejectFunc) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		var names []string
		for _, r := range rules {
			names = append(names, utils.GetFuncName(r))
		}
		di.Push(fmt.Sprintf("WithACLRules(%+v)", names))
		o.ACLRules = append(o.ACLRules, rules...)
	}}
}
func WithFirstMetaHandler(h remote.MetaHandler) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push(fmt.Sprintf("WithFirstMetaHandler(%T)", h))
		handlers := []remote.MetaHandler{h}
		o.MetaHandlers = append(handlers, o.MetaHandlers...)
	}}
}
func WithMetaHandler(h remote.MetaHandler) client.Option {
	return client.Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithMetaHandler(%T)", h))
		o.MetaHandlers = append(o.MetaHandlers, h)
	}}
}
func WithProxy(p proxy.ForwardProxy) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithProxy(%T)", p))
		if o.Proxy != nil {
			panic(fmt.Errorf("reassignment of Proxy is not allowed: %T -> %T", o.Proxy, p))
		}
		o.Proxy = p
	}}
}
func WithTransHandlerFactory(f remote.ClientTransHandlerFactory) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push(fmt.Sprintf("WithTransHandlerFactory(%T)", f))
		o.RemoteOpt.CliHandlerFactory = f
	}}
}
func WithDialer(d remote.Dialer) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push(fmt.Sprintf("WithDialer(%T)", d))
		if d == nil {
			panic("invalid Dialer: nil")
		}
		o.RemoteOpt.Dialer = d
	}}
}
func WithConnPool(pool remote.ConnPool) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithConnPool((%T)", pool))
		if o.RemoteOpt.ConnPool == nil {
			o.RemoteOpt.ConnPool = pool
		} else {
			klog.Warnf("The connection pool has been initialized. The call to WithConnPool will not take effect.")
		}
	}}
}
func WithRetryContainer(rc *retry.Container) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push("WithRetryContainer()")
		if rc == nil {
			panic("invalid retry container: nil")
		}
		o.RetryContainer = rc
	}}
}
func WithGeneric(g generic.Generic) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		o.Once.OnceOrPanic()
		di.Push(fmt.Sprintf("WithGeneric(%T)", g))
		if g == nil {
			panic("invalid Generic: nil")
		}
		if g.Framed() {
			rpcinfo.AsMutableRPCConfig(o.Configs).SetTransportProtocol(transport.Framed)
		}
		o.RemoteOpt.PayloadCodec = g.PayloadCodec()
	}}
}
func WithCloseCallbacks(callback func() error) Option {
	return Option{F: func(o *client.Options, di *utils.Slice) {
		di.Push(fmt.Sprintf("WithCloseCallbacks(%+v)", utils.GetFuncName(callback)))
		if callback == nil {
			panic("invalid Close Callback: nil")
		}
		o.CloseCallbacks = append(o.CloseCallbacks, callback)
	}}
}