Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
0f19427d
Unverified
Commit
0f19427d
authored
Jan 24, 2026
by
7. Sun
Committed by
GitHub
Jan 24, 2026
Browse files
[Perf] Cache exc.errors() result in validation exception handler (#32984)
Signed-off-by:
7. Sun
<
jhao.sun@gmail.com
>
parent
51931c5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
vllm/entrypoints/openai/api_server.py
vllm/entrypoints/openai/api_server.py
+4
-3
No files found.
vllm/entrypoints/openai/api_server.py
View file @
0f19427d
...
@@ -558,7 +558,8 @@ def build_app(args: Namespace) -> FastAPI:
...
@@ -558,7 +558,8 @@ def build_app(args: Namespace) -> FastAPI:
@
app
.
exception_handler
(
RequestValidationError
)
@
app
.
exception_handler
(
RequestValidationError
)
async
def
validation_exception_handler
(
_
:
Request
,
exc
:
RequestValidationError
):
async
def
validation_exception_handler
(
_
:
Request
,
exc
:
RequestValidationError
):
param
=
None
param
=
None
for
error
in
exc
.
errors
():
errors
=
exc
.
errors
()
for
error
in
errors
:
if
"ctx"
in
error
and
"error"
in
error
[
"ctx"
]:
if
"ctx"
in
error
and
"error"
in
error
[
"ctx"
]:
ctx_error
=
error
[
"ctx"
][
"error"
]
ctx_error
=
error
[
"ctx"
][
"error"
]
if
isinstance
(
ctx_error
,
VLLMValidationError
):
if
isinstance
(
ctx_error
,
VLLMValidationError
):
...
@@ -566,9 +567,9 @@ def build_app(args: Namespace) -> FastAPI:
...
@@ -566,9 +567,9 @@ def build_app(args: Namespace) -> FastAPI:
break
break
exc_str
=
str
(
exc
)
exc_str
=
str
(
exc
)
errors_str
=
str
(
exc
.
errors
()
)
errors_str
=
str
(
errors
)
if
exc
.
errors
()
and
errors_str
and
errors_str
!=
exc_str
:
if
errors
and
errors_str
and
errors_str
!=
exc_str
:
message
=
f
"
{
exc_str
}
{
errors_str
}
"
message
=
f
"
{
exc_str
}
{
errors_str
}
"
else
:
else
:
message
=
exc_str
message
=
exc_str
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment