1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

handle codec and transport errors

This commit is contained in:
Asim Aslam
2016-12-06 19:40:44 +00:00
parent e10259940b
commit 095793ee96
3 changed files with 25 additions and 13 deletions

View File

@ -78,7 +78,7 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp
var grr error
c, err := r.pool.getConn(address, r.opts.Transport, transport.WithTimeout(opts.DialTimeout))
if err != nil {
return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
return errors.InternalServerError("go.micro.client", fmt.Sprintf("connection error: %v", err))
}
defer func() {
// defer execution of release
@ -154,7 +154,7 @@ func (r *rpcClient) stream(ctx context.Context, address string, req Request, opt
c, err := r.opts.Transport.Dial(address, transport.WithStream(), transport.WithTimeout(opts.DialTimeout))
if err != nil {
return nil, errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
return nil, errors.InternalServerError("go.micro.client", fmt.Sprintf("connection error: %v", err))
}
stream := &rpcStream{