[Bugfix] Return HTTP 422 for unprocessable image URLs instead of 500 (#47165)

Signed-off-by: Alexis Kinsella <alexis.kinsella@gmail.com>
This commit is contained in:
Alexis K.
2026-07-06 11:56:23 +00:00
committed by GitHub
parent ba22152096
commit 40cc2e8327
5 changed files with 288 additions and 12 deletions
+2 -1
View File
@@ -51,7 +51,7 @@ from vllm.entrypoints.serve.utils.server_utils import (
log_response,
validation_exception_handler,
)
from vllm.exceptions import VLLMValidationError
from vllm.exceptions import VLLMUnprocessableEntityError, VLLMValidationError
from vllm.logger import init_logger
from vllm.reasoning import ReasoningParserManager
from vllm.renderers.online_derenderer import OnlineDerenderer
@@ -245,6 +245,7 @@ def build_app(
app.exception_handler(EngineDeadError)(engine_error_handler)
app.exception_handler(GenerationError)(generation_error_handler)
app.exception_handler(VLLMValidationError)(exception_handler)
app.exception_handler(VLLMUnprocessableEntityError)(exception_handler)
app.exception_handler(Exception)(exception_handler)
# Ensure --api-key option from CLI takes precedence over VLLM_API_KEY