File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ class ValidationError(HTTPException):
55 """
66 Исключение вызванное проблемами с валидацией
77 """
8-
8+
99 pass
Original file line number Diff line number Diff line change 1616 )
1717async def get_user (
1818 session : AsyncSession = Depends (db_connection .session_geter ),
19- ):
19+ ):
2020 session = session
2121 raise ValidationError (status_code = status .HTTP_400_BAD_REQUEST ,
2222 detail = dict (some = 'Some is wrong' ))
Original file line number Diff line number Diff line change 1- import json
21from fastapi import FastAPI , Request
32from fastapi .responses import JSONResponse
43from fastapi .exceptions import HTTPException
@@ -15,7 +14,7 @@ def register_errors(app: FastAPI) -> None:
1514 async def validation_error_handler (
1615 request : Request ,
1716 exc : ValidationError ,
18- ):
17+ ):
1918 """
2019 Логирование всех ValidationError
2120 """
@@ -31,7 +30,7 @@ async def validation_error_handler(
3130 async def http_error_handler (
3231 request : Request ,
3332 exc : HTTPException ,
34- ):
33+ ):
3534 """
3635 Логирование всех HTTPException
3736 """
@@ -47,7 +46,7 @@ async def http_error_handler(
4746 async def error_handler (
4847 request : Request ,
4948 exc : Exception ,
50- ):
49+ ):
5150 """
5251 Логирование всех Exception
5352 """
@@ -63,7 +62,7 @@ async def error_handler(
6362 async def validation_error_handler (
6463 request : Request ,
6564 exc : StarletteHTTPException ,
66- ):
65+ ):
6766 """
6867 Логирование всех StarletteHTTPException
6968 """
Original file line number Diff line number Diff line change 3333 settings .db .url ,
3434)
3535
36+
3637def run_migrations_offline () -> None :
3738 """Run migrations in 'offline' mode.
3839
You can’t perform that action at this time.
0 commit comments