فهرست منبع

Merge pull request #41215 from cpuguy83/better_plugin_errors

Add more error details on plugin get
Akihiro Suda 3 سال پیش
والد
کامیت
4283e93e64
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      pkg/plugins/plugins.go

+ 2 - 1
pkg/plugins/plugins.go

@@ -24,6 +24,7 @@ package plugins // import "github.com/docker/docker/pkg/plugins"
 
 
 import (
 import (
 	"errors"
 	"errors"
+	"fmt"
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
@@ -265,7 +266,7 @@ func Get(name, imp string) (*Plugin, error) {
 		logrus.Debugf("%s implements: %s", name, imp)
 		logrus.Debugf("%s implements: %s", name, imp)
 		return pl, nil
 		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.
 // Handle adds the specified function to the extpointHandlers.