aboutsummaryrefslogtreecommitdiff
path: root/pkg/api/api0
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-15 08:42:28 -0400
committerpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-15 08:42:28 -0400
commite0b4cc75a3e9366c5a2447a2e389a3edc68c5765 (patch)
treeb88178b8ca52dec86e5aec7eeb21311b24c9eeee /pkg/api/api0
parentdb3e8faadbc6be99c66404696c4f0ecd67148564 (diff)
downloadAtlas-e0b4cc75a3e9366c5a2447a2e389a3edc68c5765.tar.gz
Atlas-e0b4cc75a3e9366c5a2447a2e389a3edc68c5765.zip
pkg/api/api0: Add more descriptive error for attempts to update nonexistent server
Diffstat (limited to 'pkg/api/api0')
-rw-r--r--pkg/api/api0/server.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/api/api0/server.go b/pkg/api/api0/server.go
index 1efc5c2..afb4f13 100644
--- a/pkg/api/api0/server.go
+++ b/pkg/api/api0/server.go
@@ -319,6 +319,14 @@ func (h *Handler) handleServerUpsert(w http.ResponseWriter, r *http.Request) {
})
return
}
+ if errors.Is(err, ErrServerListUpdateServerDead) {
+ respJSON(w, r, http.StatusForbidden, map[string]any{
+ "success": false,
+ "error": ErrorCode_UNAUTHORIZED_GAMESERVER,
+ "msg": ErrorCode_UNAUTHORIZED_GAMESERVER.Messagef("no such server"),
+ })
+ return
+ }
if errors.Is(err, ErrServerListDuplicateAuthAddr) {
respJSON(w, r, http.StatusForbidden, map[string]any{
"success": false,