named return value for error defer modify.

This commit is contained in:
Astone 2019-12-09 11:08:21 +08:00 committed by Vasiliy Tolstov
parent 83d0560d23
commit c1382ac0b7

View File

@ -167,8 +167,7 @@ func validateSubscriber(sub server.Subscriber) error {
}
func (g *grpcServer) createSubHandler(sb *subscriber, opts server.Options) broker.Handler {
return func(p broker.Event) error {
var err error
return func(p broker.Event) (err error) {
defer func() {
if r := recover(); r != nil {