[Frontend] Consolidate entrypoint exception handler (#52261)

Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
wang.yuqi
2026-08-14 09:27:24 +00:00
committed by GitHub
parent 103c419f04
commit b8165e5e58
31 changed files with 418 additions and 343 deletions
-12
View File
@@ -10,7 +10,6 @@ from logging import Logger
from string import Template
from typing import Any
import regex as re
from fastapi import Request
from fastapi.exceptions import RequestValidationError
from fastapi.responses import JSONResponse, StreamingResponse
@@ -309,17 +308,6 @@ def process_lora_modules(
return lora_modules
def sanitize_message(message: str) -> str:
"""Strip memory addresses, tracebacks, and file paths from error messages."""
message = re.sub(r" at 0x[0-9a-f]+>", ">", message)
message = re.sub(r'\n?\s*File "[^"]+", line \d+, in \S+(\n\s+.*)?', "", message)
message = re.sub(
r"/(?:home|usr|opt|var|tmp|root|lib|mnt|srv)(?:/[\w.\-]+)+", "<path>", message
)
message = re.sub(r"(?:/[\w\-]+)+/[\w\-]+\.\w+", "<path>", message)
return message.strip()
def log_version_and_model(lgr: Logger, version: str, model_name: str) -> None:
if envs.VLLM_DISABLE_LOG_LOGO or (formatter := current_formatter_type(lgr)) is None:
message = "vLLM server version %s, serving model %s"