Graphite: Backend querying improvements (#111549)
This commit is contained in:
@@ -100,7 +100,7 @@ func (s *Service) CallResource(ctx context.Context, req *backend.CallResourceReq
|
||||
func (s *Service) createRequest(ctx context.Context, dsInfo *datasourceInfo, params URLParams) (*http.Request, error) {
|
||||
u, err := url.Parse(dsInfo.URL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, backend.DownstreamError(err)
|
||||
}
|
||||
|
||||
if params.SubPath != "" {
|
||||
@@ -125,7 +125,7 @@ func (s *Service) createRequest(ctx context.Context, dsInfo *datasourceInfo, par
|
||||
req, err := http.NewRequestWithContext(ctx, method, u.String(), params.Body)
|
||||
if err != nil {
|
||||
s.logger.Info("Failed to create request", "error", err)
|
||||
return nil, fmt.Errorf("failed to create request: %w", err)
|
||||
return nil, backend.PluginError(fmt.Errorf("failed to create request: %w", err))
|
||||
}
|
||||
|
||||
for k, v := range params.Headers {
|
||||
|
||||
Reference in New Issue
Block a user