Add debug logs when a non-500 error occurs, force sync the configuration during installation of a new server

This commit is contained in:
Matthew Penner
2020-04-10 12:00:04 -06:00
parent 62ed90e621
commit 9e30d63818
4 changed files with 13 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/pterodactyl/wings/config"
"github.com/pterodactyl/wings/server"
"go.uber.org/zap"
"net/http"
@@ -68,6 +69,12 @@ func (e *RequestError) AbortWithStatus(status int, c *gin.Context) {
}
c.Error(errors.WithStack(e))
} else if config.Get().Debug {
if e.server != nil {
zap.S().Debugw("encountered error while handling HTTP request", zap.String("server", e.server.Uuid), zap.String("error_id", e.Uuid), zap.Error(e.Err))
} else {
zap.S().Debugw("encountered error while handling HTTP request", zap.String("error_id", e.Uuid), zap.Error(e.Err))
}
}
msg := "An unexpected error was encountered while processing this request."