summaryrefslogtreecommitdiff
path: root/plugins/server/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/server/plugin.go')
-rw-r--r--plugins/server/plugin.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/server/plugin.go b/plugins/server/plugin.go
index 99d93d19..95e593b8 100644
--- a/plugins/server/plugin.go
+++ b/plugins/server/plugin.go
@@ -49,11 +49,6 @@ func (server *Plugin) Init(cfg config.Configurer, log logger.Logger) error {
server.cfg.InitDefaults()
server.log = log
- server.factory, err = server.initFactory()
- if err != nil {
- return errors.E(err)
- }
-
return nil
}
@@ -64,7 +59,14 @@ func (server *Plugin) Name() string {
// Serve (Start) server plugin (just a mock here to satisfy interface)
func (server *Plugin) Serve() chan error {
+ const op = errors.Op("server_plugin_serve")
errCh := make(chan error, 1)
+ var err error
+ server.factory, err = server.initFactory()
+ if err != nil {
+ errCh <- errors.E(op, err)
+ return errCh
+ }
return errCh
}