Less obtuse error handling from API responses

This commit is contained in:
Dane Everitt
2019-12-16 20:34:58 -08:00
parent a1fa876734
commit 514c16ccc8
4 changed files with 31 additions and 35 deletions

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"github.com/pkg/errors"
"github.com/pterodactyl/wings/parser"
"go.uber.org/zap"
)
const (
@@ -40,9 +39,7 @@ func (r *PanelRequest) GetServerConfiguration(uuid string) (*ServerConfiguration
r.Response = resp
if r.HasError() {
zap.S().Warnw("got error", zap.String("message", r.Error()))
return nil, errors.WithStack(errors.New(r.Error()))
return nil, errors.WithStack(errors.New(r.Error().String()))
}
res := &ServerConfiguration{}