Continue to return our error types
This commit is contained in:
parent
8c8573426c
commit
00a26677b8
@ -109,7 +109,7 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp
|
|||||||
case err := <-ch:
|
case err := <-ch:
|
||||||
return err
|
return err
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return ctx.Err()
|
return errors.New("go.micro.client", ctx.Err(), 408)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ func (r *rpcClient) stream(ctx context.Context, address string, req Request, opt
|
|||||||
case err := <-ch:
|
case err := <-ch:
|
||||||
grr = err
|
grr = err
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
grr = ctx.Err()
|
grr = errors.New("go.micro.client", ctx.Err(), 408)
|
||||||
}
|
}
|
||||||
|
|
||||||
if grr != nil {
|
if grr != nil {
|
||||||
@ -260,7 +260,7 @@ func (r *rpcClient) Call(ctx context.Context, request Request, response interfac
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return ctx.Err()
|
return errors.New("go.micro.client", ctx.Err(), 408)
|
||||||
case err := <-ch:
|
case err := <-ch:
|
||||||
// if the call succeeded lets bail early
|
// if the call succeeded lets bail early
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@ -354,7 +354,7 @@ func (r *rpcClient) Stream(ctx context.Context, request Request, opts ...CallOpt
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return nil, ctx.Err()
|
return nil, errors.New("go.micro.client", ctx.Err(), 408)
|
||||||
case rsp := <-ch:
|
case rsp := <-ch:
|
||||||
// if the call succeeded lets bail early
|
// if the call succeeded lets bail early
|
||||||
if rsp.err == nil {
|
if rsp.err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user