Przeglądaj źródła

tech(graphite): return error if statuscode is not ok

bergquist 9 lat temu
rodzic
commit
46d4f817e3
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      pkg/tsdb/graphite/graphite.go

+ 3 - 3
pkg/tsdb/graphite/graphite.go

@@ -102,9 +102,9 @@ func (e *GraphiteExecutor) parseResponse(res *http.Response) ([]TargetResponseDT
 		return nil, err
 	}
 
-	if res.StatusCode == http.StatusUnauthorized {
-		glog.Info("Request is Unauthorized", "status", res.Status, "body", string(body))
-		return nil, fmt.Errorf("Request is Unauthorized status: %v body: %s", res.Status, string(body))
+	if res.StatusCode/100 != 200 {
+		glog.Info("Request failed", "status", res.Status, "body", string(body))
+		return nil, fmt.Errorf("Request failed status: %v", res.Status)
 	}
 
 	var data []TargetResponseDTO