Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implementing database class #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DelaMarc
Copy link
Contributor

Implemented a database (DB) class that encapsulates all database operations end try/except exceptions related to the database
with this logic, the database is accessed through a singleton that is initialized before running the server. If an exception is caught during a database operation, the value -1 is returned.
Thus, whenever a database operation returns -1 in a server function, an error message is immediately returned with the error code 500. The error code and messages are the same everywhere by now but can be personnalized later on.
server.py and tools.py have been modified following this logic and the return of every database call is checked.

Also in the SAL and Connect4 functions in server.py, conditions have been added to redirect the user and log them out if their email happens to not be in the associated dictionnaries.

DelaMarc and others added 2 commits April 24, 2020 13:42
…end try/except exceptions related to the database

with this logic, the database is accessed through a singleton that is initialized before running the server. If an exception is caught during a database operation, the value -1 is returned.
Thus, whenever a database operation returns -1 in a server function, an error message is immediately returned with the error code 500. The error code and messages are the same everywhere by now but can be personnalized later on.
server.py and tools.py have been modified following this logic and the return of every database call is checked.

Also in the SAL and Connect4 functions in server.py, conditions have been added to redirect the user and log them out if their email happens to not be in the associated dictionnaries.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant