Compare commits
1 Commits
feature-da
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
7202376123 |
|
|
@ -314,7 +314,10 @@ def add_exception_handlers(app: FastAPI):
|
|||
|
||||
@app.exception_handler(DashboardException)
|
||||
def dashboard_exception_handler(request: Request, exc: DashboardException) -> Response:
|
||||
logger.debug(f"Handled DashboardException: {exc.__class__.__name__} - {exc.message}")
|
||||
if exc.status_code < 500:
|
||||
logger.warning(f"Handled DashboardException: {exc.__class__.__name__} - {exc.message}")
|
||||
else:
|
||||
logger.error(f"Handled DashboardException: {exc.__class__.__name__} - {exc.message}")
|
||||
return JSONResponse(
|
||||
status_code=exc.status_code,
|
||||
content={
|
||||
|
|
|
|||
Loading…
Reference in New Issue