diff --git a/internal/status/status.go b/internal/status/status.go index 710223b8ded0..4ac86ae8fc6d 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -151,8 +151,8 @@ func (e *Error) GRPCStatus() *Status { return FromProto(e.e) } -// Is implements future error.Is functionality. -// A Error is equivalent if the code and message are identical. +// Is implements Go 1.13 errors.Is functionality. +// An Error is equivalent if the code and message are identical. func (e *Error) Is(target error) bool { tse, ok := target.(*Error) if !ok { diff --git a/internal/transport/http2_client.go b/internal/transport/http2_client.go index 48c5e52edae9..ba1e1ba5b83e 100644 --- a/internal/transport/http2_client.go +++ b/internal/transport/http2_client.go @@ -619,6 +619,11 @@ func (p PerformedIOError) Error() string { return p.Err.Error() } +// Unwrap implements Go 1.13 errors.Unwrap functionality. +func (p PerformedIOError) Unwrap() error { + return p.Err +} + // NewStream creates a stream and registers it into the transport as "active" // streams. func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Stream, err error) { diff --git a/internal/transport/transport.go b/internal/transport/transport.go index 6cc1031fd92f..630bdb8e7d03 100644 --- a/internal/transport/transport.go +++ b/internal/transport/transport.go @@ -735,6 +735,11 @@ func (e ConnectionError) Temporary() bool { return e.temp } +// Unwrap implements Go 1.13 errors.Unwrap functionality. +func (e ConnectionError) Unwrap() error { + return e.err +} + // Origin returns the original error of this connection error. func (e ConnectionError) Origin() error { // Never return nil error here.