fix(platform): guard unscoped raw field queries

This commit is contained in:
lingniu
2026-07-04 12:45:53 +08:00
parent 773338cce9
commit 34116142e6
3 changed files with 77 additions and 0 deletions

View File

@@ -186,6 +186,10 @@ func (h *Handler) handleOpsHealth(w http.ResponseWriter, r *http.Request) {
func (h *Handler) write(w http.ResponseWriter, r *http.Request, data any, err error) {
if err != nil {
if clientErr, ok := asClientError(err); ok {
httpx.WriteError(w, http.StatusBadRequest, clientErr.Code, clientErr.Message, "", traceID(r))
return
}
httpx.WriteError(w, http.StatusInternalServerError, "INTERNAL", "服务处理失败", err.Error(), traceID(r))
return
}