[Frontend][Core] Standardize request error handling with VLLMError hierarchy (#49665)

Signed-off-by: Zach Zhu <zzqshu@126.com>
This commit is contained in:
Zach Zhu
2026-07-29 04:20:40 +00:00
committed by GitHub
parent f37f03db4a
commit 58f9659397
46 changed files with 370 additions and 248 deletions
+4 -3
View File
@@ -19,6 +19,7 @@ from vllm.entrypoints.openai.chat_completion.protocol import (
from vllm.entrypoints.openai.chat_completion.serving import OpenAIServingChat
from vllm.entrypoints.openai.models.protocol import BaseModelPath
from vllm.entrypoints.openai.models.serving import OpenAIServingModels
from vllm.exceptions import VLLMValidationError
from vllm.inputs import PromptType
from vllm.outputs import RequestOutput
from vllm.platforms import current_platform
@@ -485,7 +486,7 @@ async def test_dp_rank_argument():
pass
# Test with out-of-range DP rank.
with pytest.raises(ValueError):
with pytest.raises(VLLMValidationError):
async for _ in engine.generate(
request_id="request-35",
prompt=TEXT_PROMPT,
@@ -554,8 +555,8 @@ async def test_header_dp_rank_argument():
# Test 2: Out-of-range DP rank (1)
mock_raw_request.headers = {"X-data-parallel-rank": "1"}
# should raise ValueError for out-of-range rank
with pytest.raises(ValueError):
# should raise VLLMValidationError for out-of-range rank
with pytest.raises(VLLMValidationError):
await serving_chat.create_chat_completion(req, mock_raw_request)