diff --git a/app/routers/airline.py b/app/routers/airline.py index 7ebfb46..b7d251f 100644 --- a/app/routers/airline.py +++ b/app/routers/airline.py @@ -1,5 +1,5 @@ from typing import Union -from typing_extensions import Annotated +from typing import Annotated from couchbase.exceptions import DocumentExistsException, DocumentNotFoundException from app.db import get_db @@ -95,7 +95,7 @@ def get_airlines_list( airlines = [r for r in result] return airlines except Exception as e: - return f"Unexpected error: {e}", 500 + raise HTTPException(status_code=500, detail=f"Unexpected error: {e}") @router.get( @@ -153,7 +153,7 @@ def get_airlines_to_airport( airlines = [r for r in result] return airlines except Exception as e: - return HTTPException(status_code=500, detail=f"Unexpected error: {e}") + raise HTTPException(status_code=500, detail=f"Unexpected error: {e}") @router.get( diff --git a/app/routers/airport.py b/app/routers/airport.py index 7fc3f68..2cde684 100644 --- a/app/routers/airport.py +++ b/app/routers/airport.py @@ -1,5 +1,5 @@ from typing import Union -from typing_extensions import Annotated +from typing import Annotated from couchbase.exceptions import DocumentExistsException, DocumentNotFoundException from app.db import get_db as CouchbaseClient @@ -114,7 +114,7 @@ def get_airports_list( airports = [r for r in result] return airports except Exception as e: - return f"Unexpected error: {e}", 500 + raise HTTPException(status_code=500, detail=f"Unexpected error: {e}") class DestinationAirport(BaseModel): @@ -174,7 +174,7 @@ def get_airport_direct_connections( airports = [r for r in result] return airports except Exception as e: - return HTTPException(status_code=500, detail=f"Unexpected error: {e}") + raise HTTPException(status_code=500, detail=f"Unexpected error: {e}") @router.get( diff --git a/app/routers/hotel.py b/app/routers/hotel.py index c55a7d8..e56c29c 100644 --- a/app/routers/hotel.py +++ b/app/routers/hotel.py @@ -1,5 +1,5 @@ from typing import List, Optional -from typing_extensions import Annotated +from typing import Annotated from app.db import get_db as CouchbaseClient from fastapi import APIRouter, Depends, HTTPException, Query diff --git a/app/routers/route.py b/app/routers/route.py index 11350ba..af6f231 100644 --- a/app/routers/route.py +++ b/app/routers/route.py @@ -1,5 +1,5 @@ from typing import Union -from typing_extensions import Annotated +from typing import Annotated from couchbase.exceptions import DocumentExistsException, DocumentNotFoundException from app.db import get_db as CouchbaseClient diff --git a/requirements.txt b/requirements.txt index 8c4f2f7..2d717ba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ couchbase==4.6.1 fastapi==0.136.1 httpx==0.28.1 pydantic==2.13.3 -pydantic_settings==2.14.0 +pydantic-settings==2.14.0 pytest==9.0.3 python-dotenv==1.2.2 -uvicorn==0.46.0 \ No newline at end of file +uvicorn==0.46.0