Skip to content

Commit

Permalink
test: github env setting check
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-min committed Jan 24, 2024
1 parent 7b1f6d1 commit 3e49dbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Binary file modified .coverage
Binary file not shown.
5 changes: 4 additions & 1 deletion src/libs/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ def __init__(
self.db = os.environ.get('DB_NAME')

def get_session(self) -> pymongo.MongoClient:
if not self.url:
raise Exception("No url")

try:
self.client = pymongo.MongoClient(self.url)
return self.client[self.db]
except Exception as e:
DBError(**DBErrorCode.DBConnectionError.value, err=e)
raise DBError(**DBErrorCode.DBConnectionError.value, err=e)

0 comments on commit 3e49dbd

Please sign in to comment.