We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 516a31d commit 43d5389Copy full SHA for 43d5389
template/{% if has_backend %}backend{% endif %}/src/backend_api/fast_api_exception_handlers.py
@@ -43,15 +43,14 @@ def _problem_dict(
43
trace_id: str,
44
exc_type: str,
45
) -> dict[str, Any]:
46
- body: dict[str, Any] = {
47
- "type": "about:blank",
48
- "title": title,
49
- "status": status,
50
- "detail": detail,
51
- "instance": f"urn:uuid:{trace_id}",
52
- "errorType": exc_type,
53
- }
54
- return body
+ return ProblemDetails(
+ type="about:blank",
+ title=title,
+ status=status,
+ detail=detail,
+ instance=f"urn:uuid:{trace_id}",
+ errorType=exc_type,
+ ).model_dump(by_alias=True, mode="json")
55
56
57
def handle_http_exception(request: Request, exc: Exception) -> JSONResponse:
0 commit comments