Update ErrRequestErrorBase from [plugin.downstreamError] to [plugin.requestFailureError] (#100965)

* Update ErrRequestErrorBase to make it more clear for developers

* Trigger build

* requestError -> requestFailureError

* Fix test

* Update pkg/plugins/backendplugin/grpcplugin/client_v2.go

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
Ivana Huckova
2025-02-20 10:23:53 +01:00
committed by GitHub
parent c654a580f7
commit 9eda0f44ac
6 changed files with 12 additions and 13 deletions

View File

@ -356,15 +356,14 @@ func handleGrpcStatusError(ctx context.Context, errorSource errstatus.Source, er
if innerErr != nil {
logger.Error("Could not set downstream error source", "error", innerErr)
}
return plugins.ErrPluginDownstreamErrorBase.Errorf("%v", err)
return plugins.ErrPluginRequestFailureErrorBase.Errorf("%v", err)
case backend.ErrorSourcePlugin:
errorSourceErr := backend.WithErrorSource(ctx, backend.ErrorSourcePlugin)
if errorSourceErr != nil {
logger.Error("Could not set plugin error source", "error", errorSourceErr)
}
// a downstream error is returned here as plugin errors are considered as downstream errors in the
// context of the Grafana server.
return plugins.ErrPluginDownstreamErrorBase.Errorf("%v", err)
// plugin request has failed after being sent from the Grafana server
return plugins.ErrPluginRequestFailureErrorBase.Errorf("%v", err)
}
return fmt.Errorf("%v: %w", "Failed to query data", err)
}