MCPcopy Create free account
hub / github.com/mlco2/codecarbon / validation_exception_handler

Function validation_exception_handler

carbonserver/main.py:39–47  ·  view source on GitHub ↗
(request: Request, exc: ValidationError)

Source from the content-addressed store, hash-verified

37
38
39async def validation_exception_handler(request: Request, exc: ValidationError):
40 logger.error(f"ValidationError {exc}")
41 return JSONResponse(
42 {
43 "detail": "Validation error : a data is missing or in wrong format. Could be an error in our answer, not only in your request",
44 "validation_error_message": str(exc),
45 },
46 status_code=400,
47 )
48
49
50def create_app() -> FastAPI:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…