From b1a3fe49341bec714c1017067bd17d9052e5a2d6 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 15 Jul 2020 13:10:30 -0700 Subject: [PATCH] Add more error details on plugin get Seeing this `ErrNotImplements` in some of our logs and it's not very helpful because we don't know what plugin is causing it or even what the requested interface is. ``` {"message":"legacy plugin: Plugin does not implement the requested driver"} ``` Signed-off-by: Brian Goff --- pkg/plugins/plugins.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/plugins/plugins.go b/pkg/plugins/plugins.go index 2371e92101014..86023046faa04 100644 --- a/pkg/plugins/plugins.go +++ b/pkg/plugins/plugins.go @@ -24,6 +24,7 @@ package plugins // import "github.com/docker/docker/pkg/plugins" import ( "errors" + "fmt" "sync" "time" @@ -265,7 +266,7 @@ func Get(name, imp string) (*Plugin, error) { logrus.Debugf("%s implements: %s", name, imp) return pl, nil } - return nil, ErrNotImplements + return nil, fmt.Errorf("%w: plugin=%q, requested implementation=%q", ErrNotImplements, name, imp) } // Handle adds the specified function to the extpointHandlers.