Skip to content

Commit

Permalink
improve (azure-pipelines): log url on error Co-authored-by: Jorge Tur…
Browse files Browse the repository at this point in the history
…rado Ferrero <Jorge_turrado@hotmail.es>

Signed-off-by: Enderson Menezes <endersonster@gmail.com>
  • Loading branch information
endersonmenezes committed Nov 17, 2021
1 parent cf1b365 commit 92e2abe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/scalers/azure_pipelines_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (s *azurePipelinesScaler) GetAzurePipelinesQueueLength(ctx context.Context)
r.Body.Close()

if !(r.StatusCode >= 200 && r.StatusCode <= 299) {
return -1, fmt.Errorf("azure Devops REST api returned error. status: %d response: %s", r.StatusCode, string(b))
return -1, fmt.Errorf("Azure DevOps REST api returned error. url: %s status: %d response: %s", string(url, r.StatusCode, string(b))
}

var result map[string]interface{}
Expand All @@ -152,7 +152,7 @@ func (s *azurePipelinesScaler) GetAzurePipelinesQueueLength(ctx context.Context)
jobs, ok := result["value"].([]interface{})

if !ok {
return -1, fmt.Errorf("api result returned no value data")
return -1, fmt.Errorf("api (%s) result returned no value data", string(url))
}

for _, value := range jobs {
Expand Down

0 comments on commit 92e2abe

Please sign in to comment.