Skip to content

Commit 61c13c6

Browse files
authored
Merge pull request #131 from OpenCodeIntel/feat/125-anonymous-indexing
feat(playground): Anonymous repository indexing (#125)
2 parents 01c18f0 + ae605cc commit 61c13c6

6 files changed

Lines changed: 1551 additions & 31 deletions

File tree

backend/main.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,22 @@ async def dispatch(self, request: Request, call_next):
9898
@app.exception_handler(RequestValidationError)
9999
async def validation_exception_handler(request: Request, exc: RequestValidationError):
100100
"""Handle validation errors with clear messages."""
101+
# Convert errors to JSON-serializable format
102+
errors = []
103+
for err in exc.errors():
104+
error_dict = {
105+
"type": err.get("type"),
106+
"loc": err.get("loc"),
107+
"msg": err.get("msg"),
108+
"input": str(err.get("input")) if err.get("input") is not None else None,
109+
}
110+
errors.append(error_dict)
111+
101112
return JSONResponse(
102113
status_code=422,
103114
content={
104115
"detail": "Validation error",
105-
"errors": exc.errors()
116+
"errors": errors
106117
}
107118
)
108119

0 commit comments

Comments
 (0)