Skip to content

Commit

Permalink
panic: uninstall plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Jan 13, 2025
1 parent ecb0664 commit 2eb1e2c
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions internal/core/plugin_manager/local_runtime/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,25 @@ func (r *LocalPluginRuntime) StartPlugin() error {

defer func() {
// wait for plugin to exit
err = e.Wait()
if err != nil {
originalErr := e.Wait()
if originalErr != nil {
// get stdio
var err error
if stdio != nil {
err = stdio.Error()
stdioErr := stdio.Error()
if stdioErr != nil {
err = errors.Join(originalErr, stdioErr)
} else {
err = originalErr
}
} else {
err = originalErr
}
if err != nil {
log.Error("plugin %s exited with error: %s", r.Config.Identity(), err.Error())
} else {
log.Error("plugin %s exited with unknown error", r.Config.Identity())
}
err = errors.Join(err, err)
log.Error("plugin %s exited with error: %s", r.Config.Identity(), err.Error())
}

r.gc()
Expand Down

0 comments on commit 2eb1e2c

Please sign in to comment.