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

@@ -63,13 +63,13 @@ func New(data []byte) (*Installer, error) {
cfg.Container.Image = getString(data, "container", "image")
c, rerr, err := api.NewRequester().GetServerConfiguration(cfg.Uuid)
if err != nil || rerr != nil {
if err != nil {
c, err := api.New().GetServerConfiguration(cfg.Uuid)
if err != nil {
if !api.IsRequestError(err) {
return nil, errors.WithStack(err)
}
return nil, errors.New(rerr.String())
return nil, errors.New(err.Error())
}
// Create a new server instance using the configuration we wrote to the disk