From ae7e6dc2d774fd00e5e63bdaec187c0696029822 Mon Sep 17 00:00:00 2001 From: Maksim Dorokhin Date: Wed, 20 Apr 2022 09:31:37 +0000 Subject: [PATCH] add error to plugin start. --- internal/plugins/manager.go | 6 ++++-- pkg/types/plugins.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/plugins/manager.go b/internal/plugins/manager.go index 776363bc..aa902722 100644 --- a/internal/plugins/manager.go +++ b/internal/plugins/manager.go @@ -94,13 +94,15 @@ func (manager *ManagerCtx) Start( webSocketManager types.WebSocketManager, apiManager types.ApiManager, ) { - for _, plug := range manager.plugins { - plug.Start(types.PluginManagers{ + for path, plug := range manager.plugins { + err := plug.Start(types.PluginManagers{ SessionManager: sessionManager, WebSocketManager: webSocketManager, ApiManager: apiManager, LoadServiceFromPlugin: manager.LookupService, }) + + manager.logger.Err(err).Str("plugin", path).Msg("plugin start") } } diff --git a/pkg/types/plugins.go b/pkg/types/plugins.go index f6014e0b..27887aa6 100644 --- a/pkg/types/plugins.go +++ b/pkg/types/plugins.go @@ -9,7 +9,7 @@ import ( type Plugin interface { Name() string Config() PluginConfig - Start(PluginManagers) + Start(PluginManagers) error Shutdown() error }