Skip to content

Commit

Permalink
fix: Return empty list if user email doesnt exists (#2352)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleixhub authored Jan 15, 2025
1 parent 36a429e commit 137cad5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ratings/api/routers/bookmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ async def bookmarks_get(email: str) -> BookmarkListResponseSchema:
]
return BookmarkListResponseSchema(bookmarks=bookmarks_response)
else:
raise HTTPException(status_code=404, detail="User email doesn't exists") from e
logger.info(f"User email doesn't exists {email}")
return BookmarkListResponseSchema(bookmarks=[])
except Exception as e:
logger.error(f"Error getting favorite: {e}", stack_info=True)
raise HTTPException(status_code=500, detail="Error getting favorites") from e
Expand Down

0 comments on commit 137cad5

Please sign in to comment.