Skip to content

Commit

Permalink
prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanMT committed Jul 9, 2023
1 parent db79b30 commit a2f1d12
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from fastapi import FastAPI
from fastapi import FastAPI, Request
from fastapi.exceptions import RequestValidationError
from fastapi.exception_handlers import (
http_exception_handler,
request_validation_exception_handler,
)
from starlette.middleware.cors import CORSMiddleware
from starlette.exceptions import HTTPException
from starlette.responses import Response
from app.router import api_router
from app.services.populate_service import students_bulkwrite

Expand All @@ -16,7 +17,7 @@
Related documentation and links about this template.
[FastAPI](https://fastapi.tiangolo.com/): A modern, fast (high-performance), web framework for building APIs with Python
[FastAPI](https://fastapi.tiangolo.com/): Modern web framework for building APIs with Python.
[Pydantic](https://pydantic-docs.helpmanual.io/): Data validation library for Python.
Expand All @@ -36,12 +37,12 @@


@app.exception_handler(HTTPException)
async def custom_http_exception_handler(request, exc):
async def custom_http_exception_handler(request: Request, exc: HTTPException) -> Response:
return await http_exception_handler(request, exc)


@app.exception_handler(RequestValidationError)
async def validation_exception_handler(request, exc):
async def validation_exception_handler(request: Request, exc: RequestValidationError) -> Response:
return await request_validation_exception_handler(request, exc)


Expand Down

0 comments on commit a2f1d12

Please sign in to comment.