Plugin load errors: Add more well-known errors (#85960)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -106,7 +106,10 @@ func (a *AngularDetector) Validate(ctx context.Context, p *plugins.Plugin) error
|
||||
// Do not initialize plugins if they're using Angular and Angular support is disabled
|
||||
if p.Angular.Detected && !a.cfg.AngularSupportEnabled {
|
||||
a.log.Error("Refusing to initialize plugin because it's using Angular, which has been disabled", "pluginId", p.ID)
|
||||
return errors.New("angular plugins are not supported")
|
||||
return (&plugins.Error{
|
||||
PluginID: p.ID,
|
||||
ErrorCode: plugins.ErrorAngular,
|
||||
}).WithMessage("angular plugins are not supported")
|
||||
}
|
||||
}
|
||||
p.Angular.HideDeprecation = slices.Contains(a.cfg.HideAngularDeprecation, p.ID)
|
||||
|
||||
Reference in New Issue
Block a user