Skip to content

Commit 9bfc3ec

Browse files
jopemachineclaude
andcommitted
fix(BA-6003): restore indent=2 JSON dump in coordinator exception log
The dual-catch unification accidentally degraded the log payload from ex.json(indent=2) (the ValidationError-only path) to str(ex) (the unified path). Both BackendAISchemaValidationFailed and ValidationError expose errors(), so we can keep the indented JSON shape via json.dumps(ex.errors(), indent=2, default=str). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 718218c commit 9bfc3ec

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/ai/backend/appproxy/coordinator/server.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import importlib
77
import importlib.resources
88
import ipaddress
9+
import json
910
import logging
1011
import os
1112
import pwd
@@ -200,7 +201,10 @@ async def exception_middleware(
200201
except (BackendAISchemaValidationFailed, ValidationError) as ex:
201202
# ``ValidationError`` covers plain ``BaseModel`` subclasses that
202203
# skip the ``BackendAISchema`` auto-conversion override.
203-
log.exception("Failed to create response model: {}", ex)
204+
log.exception(
205+
"Failed to create response model: {}",
206+
json.dumps(ex.errors(), indent=2, default=str),
207+
)
204208
raise InternalServerError() from ex
205209
except BackendAIError as ex:
206210
if ex.status_code == 500:

0 commit comments

Comments
 (0)