router(transfer): throw error if server fails to stop

This commit is contained in:
Matthew Penner 2023-01-24 12:36:02 -07:00
parent 6e0c095bb8
commit a36cab1783
No known key found for this signature in database

View File

@ -6,6 +6,7 @@ import (
"strings" "strings"
"time" "time"
"emperror.dev/errors"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/pterodactyl/wings/environment" "github.com/pterodactyl/wings/environment"
@ -67,7 +68,7 @@ func postServerTransfer(c *gin.Context) {
false, false,
); err != nil && !strings.Contains(strings.ToLower(err.Error()), "no such container") { ); err != nil && !strings.Contains(strings.ToLower(err.Error()), "no such container") {
s.SetTransferring(false) s.SetTransferring(false)
s.Log().WithError(err).Error("failed to stop server for transfer") middleware.CaptureAndAbort(c, errors.Wrap(err, "failed to stop server for transfer"))
return return
} }
} }