mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
app/vmbackup/snapshot: log url and response body on failed JSON response parsing
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/929
This commit is contained in:
parent
0463cb5550
commit
b35b3dc043
@ -39,7 +39,7 @@ func Create(createSnapshotURL string) (string, error) {
|
||||
snap := snapshot{}
|
||||
err = json.Unmarshal(body, &snap)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return "", fmt.Errorf("cannot parse JSON response from %q: %w; response body: %q", createSnapshotURL, err, body)
|
||||
}
|
||||
|
||||
if snap.Status == "ok" {
|
||||
@ -77,7 +77,7 @@ func Delete(deleteSnapshotURL string, snapshotName string) error {
|
||||
snap := snapshot{}
|
||||
err = json.Unmarshal(body, &snap)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("cannot parse JSON response from %q: %w; response body: %q", deleteSnapshotURL, err, body)
|
||||
}
|
||||
|
||||
if snap.Status == "ok" {
|
||||
|
Loading…
Reference in New Issue
Block a user