diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2020-04-17 12:01:01 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2020-04-29 00:28:41 +0200 |
commit | 07d60bc2571ba3d680f21adc84d87803ab4959c6 (patch) | |
tree | dc8ab3a0671c62b632c5a5056072f3f20923f4fe /daemon/attach.go | |
parent | 45369c61a48c755f3baee416f117e47d0127a42d (diff) | |
download | docker-07d60bc2571ba3d680f21adc84d87803ab4959c6.tar.gz |
Replace errors.Cause() with errors.Is() / errors.As()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'daemon/attach.go')
-rw-r--r-- | daemon/attach.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/daemon/attach.go b/daemon/attach.go index 5c3ceb8790..c6553f79d3 100644 --- a/daemon/attach.go +++ b/daemon/attach.go @@ -176,7 +176,8 @@ func (daemon *Daemon) containerAttach(c *container.Container, cfg *stream.Attach ctx := c.InitAttachContext() err := <-c.StreamConfig.CopyStreams(ctx, cfg) if err != nil { - if _, ok := errors.Cause(err).(term.EscapeError); ok || err == context.Canceled { + var ierr term.EscapeError + if errors.Is(err, context.Canceled) || errors.As(err, &ierr) { daemon.LogContainerEvent(c, "detach") } else { logrus.Errorf("attach failed with error: %v", err) |