Skip to content

Commit

Permalink
pkg/api/api0: Include address in server upsert verification error
Browse files Browse the repository at this point in the history
  • Loading branch information
pg9182 committed Jun 17, 2023
1 parent 6c4c553 commit 65fbc1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/api/api0/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func (h *Handler) handleServerUpsert(w http.ResponseWriter, r *http.Request) {
h.m().server_upsert_requests_total.reject_verify_autherr(action).Inc()
}
h.m().server_upsert_verify_time_seconds.failure.UpdateDuration(verifyStart)
respFail(w, r, http.StatusBadGateway, code.MessageObjf("failed to connect to auth port: %v", err))
respFail(w, r, http.StatusBadGateway, code.MessageObjf("failed to connect to auth port (addr %s): %v", nsrv.AuthAddr(), err))
return
}
}
Expand All @@ -396,10 +396,10 @@ func (h *Handler) handleServerUpsert(w http.ResponseWriter, r *http.Request) {
switch {
case errors.Is(err, context.DeadlineExceeded):
h.m().server_upsert_requests_total.reject_verify_udptimeout(action).Inc()
obj = ErrorCode_NO_GAMESERVER_RESPONSE.MessageObjf("failed to connect to game port")
obj = ErrorCode_NO_GAMESERVER_RESPONSE.MessageObjf("failed to connect to game port (addr %s)", nsrv.Addr)
default:
h.m().server_upsert_requests_total.reject_verify_udperr(action).Inc()
obj = ErrorCode_INTERNAL_SERVER_ERROR.MessageObjf("failed to connect to game port: %v", err)
obj = ErrorCode_INTERNAL_SERVER_ERROR.MessageObjf("failed to connect to game port (addr %s): %v", nsrv.Addr, err)
}
h.m().server_upsert_verify_time_seconds.failure.UpdateDuration(verifyStart)
respFail(w, r, http.StatusBadGateway, obj)
Expand All @@ -410,7 +410,7 @@ func (h *Handler) handleServerUpsert(w http.ResponseWriter, r *http.Request) {

if !h.ServerList.VerifyServer(nsrv.ID) {
h.m().server_upsert_requests_total.reject_verify_udptimeout(action).Inc()
respFail(w, r, http.StatusBadGateway, ErrorCode_NO_GAMESERVER_RESPONSE.MessageObjf("verification timed out"))
respFail(w, r, http.StatusBadGateway, ErrorCode_NO_GAMESERVER_RESPONSE.MessageObjf("verification timed out (addr %s)", nsrv.Addr))
return
}

Expand Down

0 comments on commit 65fbc1f

Please sign in to comment.