Refactor HTTP endpoints to be less complicated and follow better standards

This commit is contained in:
Dane Everitt
2020-10-31 10:04:20 -07:00
parent c4703f5541
commit 334b3e8d10
12 changed files with 203 additions and 245 deletions

View File

@@ -32,13 +32,13 @@ func LoadDirectory() error {
}
log.Info("fetching list of servers from API")
configs, rerr, err := api.NewRequester().GetAllServerConfigurations()
if err != nil || rerr != nil {
if err != nil {
configs, err := api.New().GetAllServerConfigurations()
if err != nil {
if !api.IsRequestError(err) {
return errors.WithStack(err)
}
return errors.New(rerr.String())
return errors.New(err.Error())
}
start := time.Now()