Skip to content
Snippets Groups Projects
Commit 47ea0daa authored by Thomas Schneider's avatar Thomas Schneider
Browse files

CreateRecord: more debugging log, hopefully

parent 11ca0a61
No related branches found
No related tags found
No related merge requests found
Pipeline #4170 passed
...@@ -3,6 +3,7 @@ package rwthdns ...@@ -3,6 +3,7 @@ package rwthdns
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
...@@ -155,9 +156,18 @@ func (c *Client) CreateRecord(content string) (Record, error) { ...@@ -155,9 +156,18 @@ func (c *Client) CreateRecord(content string) (Record, error) {
return Record{}, err return Record{}, err
} }
dec := json.NewDecoder(res.Body) b, err := io.ReadAll(res.Body)
if err != nil {
return Record{}, err
}
bs := string(b)
dec := json.NewDecoder(strings.NewReader(bs))
var r Record var r Record
err = dec.Decode(&r) err = dec.Decode(&r)
if err != nil {
err = fmt.Errorf("Decode: %w (%s)", err, bs)
}
return r, err return r, err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment