named return value for error defer modify.
This commit is contained in:
parent
e2b2a30668
commit
caa1bcf9fe
@ -167,8 +167,7 @@ func validateSubscriber(sub server.Subscriber) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *grpcServer) createSubHandler(sb *subscriber, opts server.Options) broker.Handler {
|
func (g *grpcServer) createSubHandler(sb *subscriber, opts server.Options) broker.Handler {
|
||||||
return func(p broker.Event) error {
|
return func(p broker.Event) (err error) {
|
||||||
var err error
|
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
|
@ -506,8 +506,7 @@ func (router *router) Subscribe(s Subscriber) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (router *router) ProcessMessage(ctx context.Context, msg Message) error {
|
func (router *router) ProcessMessage(ctx context.Context, msg Message) (err error) {
|
||||||
var err error
|
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
// recover any panics
|
// recover any panics
|
||||||
|
@ -16,8 +16,7 @@ type microTransport struct {
|
|||||||
fn func(transport.Socket)
|
fn func(transport.Socket)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *microTransport) Stream(ts pb.Transport_StreamServer) error {
|
func (m *microTransport) Stream(ts pb.Transport_StreamServer) (err error) {
|
||||||
var err error
|
|
||||||
|
|
||||||
sock := &grpcTransportSocket{
|
sock := &grpcTransportSocket{
|
||||||
stream: ts,
|
stream: ts,
|
||||||
|
Loading…
Reference in New Issue
Block a user