Skip to content

Commit 78a0b3a

Browse files
authored
Update deps and retest quickstart flow (#227)
* Fix FastAPI error handling responses * Remove unnecessary typing_extensions dependency --------- Co-authored-by: Dex the DevEx Assistant <dex-the-ai@users.noreply.github.com>
1 parent 7c17f95 commit 78a0b3a

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

app/routers/airline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Union
2-
from typing_extensions import Annotated
2+
from typing import Annotated
33

44
from couchbase.exceptions import DocumentExistsException, DocumentNotFoundException
55
from app.db import get_db
@@ -95,7 +95,7 @@ def get_airlines_list(
9595
airlines = [r for r in result]
9696
return airlines
9797
except Exception as e:
98-
return f"Unexpected error: {e}", 500
98+
raise HTTPException(status_code=500, detail=f"Unexpected error: {e}")
9999

100100

101101
@router.get(
@@ -153,7 +153,7 @@ def get_airlines_to_airport(
153153
airlines = [r for r in result]
154154
return airlines
155155
except Exception as e:
156-
return HTTPException(status_code=500, detail=f"Unexpected error: {e}")
156+
raise HTTPException(status_code=500, detail=f"Unexpected error: {e}")
157157

158158

159159
@router.get(

app/routers/airport.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Union
2-
from typing_extensions import Annotated
2+
from typing import Annotated
33

44
from couchbase.exceptions import DocumentExistsException, DocumentNotFoundException
55
from app.db import get_db as CouchbaseClient
@@ -114,7 +114,7 @@ def get_airports_list(
114114
airports = [r for r in result]
115115
return airports
116116
except Exception as e:
117-
return f"Unexpected error: {e}", 500
117+
raise HTTPException(status_code=500, detail=f"Unexpected error: {e}")
118118

119119

120120
class DestinationAirport(BaseModel):
@@ -174,7 +174,7 @@ def get_airport_direct_connections(
174174
airports = [r for r in result]
175175
return airports
176176
except Exception as e:
177-
return HTTPException(status_code=500, detail=f"Unexpected error: {e}")
177+
raise HTTPException(status_code=500, detail=f"Unexpected error: {e}")
178178

179179

180180
@router.get(

app/routers/hotel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import List, Optional
2-
from typing_extensions import Annotated
2+
from typing import Annotated
33

44
from app.db import get_db as CouchbaseClient
55
from fastapi import APIRouter, Depends, HTTPException, Query

app/routers/route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Union
2-
from typing_extensions import Annotated
2+
from typing import Annotated
33

44
from couchbase.exceptions import DocumentExistsException, DocumentNotFoundException
55
from app.db import get_db as CouchbaseClient

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ couchbase==4.6.1
22
fastapi==0.136.1
33
httpx==0.28.1
44
pydantic==2.13.3
5-
pydantic_settings==2.14.0
5+
pydantic-settings==2.14.0
66
pytest==9.0.3
77
python-dotenv==1.2.2
8-
uvicorn==0.46.0
8+
uvicorn==0.46.0

0 commit comments

Comments
 (0)