diff options
| author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-15 08:42:28 -0400 |
|---|---|---|
| committer | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-15 08:42:28 -0400 |
| commit | e0b4cc75a3e9366c5a2447a2e389a3edc68c5765 (patch) | |
| tree | b88178b8ca52dec86e5aec7eeb21311b24c9eeee /pkg/api/api0 | |
| parent | db3e8faadbc6be99c66404696c4f0ecd67148564 (diff) | |
| download | Atlas-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.go | 8 |
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, |
