Plugin load errors: Add more well-known errors (#85960)

This commit is contained in:
Andres Martinez Gotor
2024-04-18 13:04:22 +02:00
committed by GitHub
parent 80e63b5206
commit 0f4a47b180
6 changed files with 36 additions and 6 deletions
@@ -79,8 +79,11 @@ func newBackendProcessStarter(processManager process.Manager) *BackendClientStar
// Start will start the backend plugin process.
func (b *BackendClientStarter) Start(ctx context.Context, p *plugins.Plugin) (*plugins.Plugin, error) {
if err := b.processManager.Start(ctx, p); err != nil {
b.log.Error("Could not start plugin", "pluginId", p.ID, "error", err)
return nil, err
b.log.Error("Could not start plugin backend", "pluginId", p.ID, "error", err)
return nil, (&plugins.Error{
PluginID: p.ID,
ErrorCode: plugins.ErrorCodeFailedBackendStart,
}).WithMessage(err.Error())
}
return p, nil
}