mirror of
https://github.com/mudler/luet.git
synced 2025-08-01 15:28:20 +00:00
Set proper error message on plugin failure
Currently we are setting the error message in a no-space full sentence which is pretty ugly: | FATA[0000] Pluginluet-cosignat/usr/local/bin/luet-cosignErrorerror while executing plugin: exit status 1 Signed-off-by: Itxaka <igarcia@suse.com>
This commit is contained in:
parent
144c409908
commit
7cd455fff4
@ -1,6 +1,7 @@
|
||||
package bus
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/mudler/go-pluggable"
|
||||
"github.com/mudler/luet/pkg/api/core/types"
|
||||
)
|
||||
@ -88,7 +89,8 @@ 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() {
|
||||
ctx.Fatal("Plugin", p.Name, "at", p.Executable, "Error", r.Error)
|
||||
err := fmt.Sprintf("Plugin %s at %s had an error: %s", p.Name, p.Executable, r.Error)
|
||||
ctx.Fatal(err)
|
||||
}
|
||||
ctx.Debug(
|
||||
"plugin_event",
|
||||
|
Loading…
Reference in New Issue
Block a user