MCPcopy
hub / github.com/Gozargah/Marzban / validation_exception_handler

Function validation_exception_handler

app/__init__.py:67–74  ·  view source on GitHub ↗
(request: Request, exc: RequestValidationError)

Source from the content-addressed store, hash-verified

65
66@app.exception_handler(RequestValidationError)
67def validation_exception_handler(request: Request, exc: RequestValidationError):
68 details = {}
69 for error in exc.errors():
70 details[error["loc"][-1]] = error.get("msg")
71 return JSONResponse(
72 status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
73 content=jsonable_encoder({"detail": details}),
74 )

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected