Datasources: Handle URL parsing error (#25742)

Adds handling of error returned from URL parsing.

Fixes #25714
This commit is contained in:
Marcus Efraimsson
2020-06-22 16:34:40 +02:00
committed by GitHub
parent c16890c22d
commit 58cefe73ee
7 changed files with 28 additions and 8 deletions

View File

@@ -656,7 +656,10 @@ func calcBucketBound(bucketOptions stackdriverBucketOptions, n int) string {
}
func (e *StackdriverExecutor) createRequest(ctx context.Context, dsInfo *models.DataSource, query *stackdriverQuery, proxyPass string) (*http.Request, error) {
u, _ := url.Parse(dsInfo.Url)
u, err := url.Parse(dsInfo.Url)
if err != nil {
return nil, err
}
u.Path = path.Join(u.Path, "render")
req, err := http.NewRequest(http.MethodGet, "https://monitoring.googleapis.com/", nil)