SSE/Chore: cleanup some error messages (#34738)

removes "rpc error: code = InvalidArgument desc =" like strings from error messages.

This came from old grpc stuff left from when SSE was a plugin (that probably should
not have been used even when it was a plugin)
This commit is contained in:
Kyle Brandt 2021-05-26 09:15:21 -04:00 committed by GitHub
parent 9dafd4f863
commit 9016d20c4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,8 +13,6 @@ import (
"github.com/grafana/grafana/pkg/plugins"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
var (
@ -91,7 +89,7 @@ type TimeRange struct {
// or are datasource requests.
func (s *Service) TransformData(ctx context.Context, req *Request) (r *backend.QueryDataResponse, err error) {
if s.isDisabled() {
return nil, status.Error(codes.PermissionDenied, "Expressions are disabled")
return nil, fmt.Errorf("server side expressions are disabled")
}
start := time.Now()
@ -111,20 +109,20 @@ func (s *Service) TransformData(ctx context.Context, req *Request) (r *backend.Q
// and parsing graph nodes from the queries.
pipeline, err := s.BuildPipeline(req)
if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
return nil, err
}
// Execute the pipeline
responses, err := s.ExecutePipeline(ctx, pipeline)
if err != nil {
return nil, status.Error(codes.Unknown, err.Error())
return nil, err
}
// Get which queries have the Hide property so they those queries' results
// can be excluded from the response.
hidden, err := hiddenRefIDs(req.Queries)
if err != nil {
return nil, status.Error((codes.Internal), err.Error())
return nil, err
}
if len(hidden) != 0 {