Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit c7ec6e8

Browse files
authored
Merge pull request #407 from thaJeztah/19.03_backport_better_container_error
[19.03 backport] Propagate GetContainer error from event processor Upstream-commit: 0e8949a003204b63f4c55cb5beb38754efed020c Component: engine
2 parents 006085f + b6eaafe commit c7ec6e8

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

components/engine/daemon/monitor.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"
22

33
import (
44
"context"
5-
"errors"
6-
"fmt"
75
"runtime"
86
"strconv"
97
"time"
@@ -12,6 +10,7 @@ import (
1210
"github.com/docker/docker/container"
1311
libcontainerdtypes "github.com/docker/docker/libcontainerd/types"
1412
"github.com/docker/docker/restartmanager"
13+
"github.com/pkg/errors"
1514
"github.com/sirupsen/logrus"
1615
)
1716

@@ -29,8 +28,8 @@ func (daemon *Daemon) setStateCounter(c *container.Container) {
2928
// ProcessEvent is called by libcontainerd whenever an event occurs
3029
func (daemon *Daemon) ProcessEvent(id string, e libcontainerdtypes.EventType, ei libcontainerdtypes.EventInfo) error {
3130
c, err := daemon.GetContainer(id)
32-
if c == nil || err != nil {
33-
return fmt.Errorf("no such container: %s", id)
31+
if err != nil {
32+
return errors.Wrapf(err, "could not find container %s", id)
3433
}
3534

3635
switch e {

0 commit comments

Comments
 (0)