1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Integration tests running in azure pipelines (#516)

This commit is contained in:
Craig Peterson
2019-07-02 12:32:54 -04:00
committed by GitHub
parent ffc0a10c64
commit 08deda6746
3 changed files with 78 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strconv"
"strings"
@@ -371,6 +372,8 @@ func (c *CloudflareApi) get(endpoint string, target interface{}) error {
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
dat, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(dat))
return errors.Errorf("bad status code from cloudflare: %d not 200", resp.StatusCode)
}
decoder := json.NewDecoder(resp.Body)