Log debug before failing (#263)

If a plugin failed, we were skipping the debug info which is kind of
useful :=)

Signed-off-by: Itxaka <igarcia@suse.com>
This commit is contained in:
Itxaka 2021-10-26 11:18:56 +02:00 committed by GitHub
parent e705c471eb
commit 1f0324c452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}
})
}
}