mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 05:30:12 +08:00
Alerting: Fix plugin not found error during condition validation (#102437)
improve error
This commit is contained in:
@ -37,7 +37,7 @@ func (e *ConditionValidator) Validate(ctx EvaluationContext, condition models.Co
|
||||
case expr.TypeDatasourceNode:
|
||||
p, found := e.pluginsStore.Plugin(ctx.Ctx, query.DataSource.Type)
|
||||
if !found { // technically this should fail earlier during datasource resolution phase.
|
||||
return fmt.Errorf("datasource refID %s could not be found: %w", query.RefID, plugins.ErrPluginUnavailable)
|
||||
return fmt.Errorf("plugin %s could not be found for datasource query refID %s: %w", query.DataSource.Type, query.RefID, plugins.ErrPluginNotRegistered)
|
||||
}
|
||||
if !p.Backend {
|
||||
return fmt.Errorf("datasource refID %s is not a backend datasource", query.RefID)
|
||||
@ -45,7 +45,7 @@ func (e *ConditionValidator) Validate(ctx EvaluationContext, condition models.Co
|
||||
case expr.TypeMLNode:
|
||||
_, found := e.pluginsStore.Plugin(ctx.Ctx, query.DataSource.Type)
|
||||
if !found {
|
||||
return fmt.Errorf("datasource refID %s could not be found: %w", query.RefID, plugins.ErrPluginUnavailable)
|
||||
return fmt.Errorf("plugin %s could not be found for datasource query refID %s: %w", query.DataSource.Type, query.RefID, plugins.ErrPluginNotRegistered)
|
||||
}
|
||||
case expr.TypeCMDNode:
|
||||
}
|
||||
|
Reference in New Issue
Block a user