From 1f0324c452c17555ca29e2b263c15dc76b425d3b Mon Sep 17 00:00:00 2001 From: Itxaka Date: Tue, 26 Oct 2021 11:18:56 +0200 Subject: [PATCH] Log debug before failing (#263) If a plugin failed, we were skipping the debug info which is kind of useful :=) Signed-off-by: Itxaka --- pkg/api/core/bus/events.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/api/core/bus/events.go b/pkg/api/core/bus/events.go index 3232c253..7ed92f92 100644 --- a/pkg/api/core/bus/events.go +++ b/pkg/api/core/bus/events.go @@ -88,10 +88,6 @@ func (b *Bus) Initialize(ctx *types.Context, plugin ...string) { for _, e := range b.Manager.Events { b.Manager.Response(e, func(p *pluggable.Plugin, r *pluggable.EventResponse) { - if r.Errored() { - err := fmt.Sprintf("Plugin %s at %s had an error: %s", p.Name, p.Executable, r.Error) - ctx.Fatal(err) - } ctx.Debug( "plugin_event", "received from", @@ -100,6 +96,10 @@ func (b *Bus) Initialize(ctx *types.Context, plugin ...string) { p.Executable, r, ) + if r.Errored() { + err := fmt.Sprintf("Plugin %s at %s had an error: %s", p.Name, p.Executable, r.Error) + ctx.Fatal(err) + } }) } }