Skip to content

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant