Continue to return our error types

This commit is contained in:
Asim 2016-05-12 23:52:29 +01:00
parent 8c8573426c
commit 00a26677b8

View File

@ -109,7 +109,7 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp
case err := <-ch:
return err
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:
grr = err
case <-ctx.Done():
grr = ctx.Err()
grr = errors.New("go.micro.client", ctx.Err(), 408)
}
if grr != nil {
@ -260,7 +260,7 @@ func (r *rpcClient) Call(ctx context.Context, request Request, response interfac
select {
case <-ctx.Done():
return ctx.Err()
return errors.New("go.micro.client", ctx.Err(), 408)
case err := <-ch:
// if the call succeeded lets bail early
if err == nil {
@ -354,7 +354,7 @@ func (r *rpcClient) Stream(ctx context.Context, request Request, opts ...CallOpt
select {
case <-ctx.Done():
return nil, ctx.Err()
return nil, errors.New("go.micro.client", ctx.Err(), 408)
case rsp := <-ch:
// if the call succeeded lets bail early
if rsp.err == nil {