status property is not a string

This commit is contained in:
2023-09-07 15:09:00 -05:00
parent e2f6da1b5f
commit 77f520aa31
2 changed files with 9 additions and 9 deletions

View File

@@ -7,7 +7,6 @@ import (
"fmt"
"io"
"net/http"
"strings"
log "github.com/sirupsen/logrus"
"golang.org/x/oauth2"
@@ -121,8 +120,9 @@ func UpdateProperty(c *Config, p []properties.PropertyUpdateOrCreate) error {
log.Fatal(err)
return err
}
if strings.HasPrefix("2", res.Status) {
log.Error(rp[0].Status + rp[0].Description)
if rp[0].Status >= 400 {
log.Error(fmt.Sprint(rp[0].Status) + ":" + rp[0].Description)
}
return nil
@@ -162,7 +162,7 @@ func DeleteProperty(c *Config, p []properties.PropertyDelete) error {
return err
}
log.Debug(string(response))
log.Debug("client.DeleteProperty: response is " + string(response))
rp := []properties.PropertyDelete{}
@@ -172,8 +172,8 @@ func DeleteProperty(c *Config, p []properties.PropertyDelete) error {
return err
}
if strings.HasPrefix("2", res.Status) {
log.Error(rp[0].Status + rp[0].Description)
if rp[0].Status >= 400 {
log.Error(fmt.Sprint(rp[0].Status) + ":" + rp[0].Description)
}
return nil