Skip to content

Commit

Permalink
Add logging when OperationalError is raised
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-lawson committed Mar 25, 2024
1 parent e4da03f commit 2b37232
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/lobbyconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ async def on_message_received(self, message):
self.get_user_identifier(),
cmd
)
except OperationalError:
except OperationalError as e:

Check failure on line 219 in server/lobbyconnection.py

View workflow job for this annotation

GitHub Actions / flake8

local variable 'e' is assigned to but never used

Check notice on line 219 in server/lobbyconnection.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

server/lobbyconnection.py#L219

local variable 'e' is assigned to but never used (F841)
# When the database goes down, SqlAlchemy will throw an OperationalError
self._logger.error(f'Encountered OperationalError on message received. This could indicate DB is down.')

Check warning on line 221 in server/lobbyconnection.py

View workflow job for this annotation

GitHub Actions / flake8

Single quotes found but double quotes preferred

Check failure on line 221 in server/lobbyconnection.py

View workflow job for this annotation

GitHub Actions / flake8

f-string is missing placeholders

Check notice on line 221 in server/lobbyconnection.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

server/lobbyconnection.py#L221

f-string is missing placeholders (F541)
await self.send({
"command": "notice",
"style": "error",
Expand Down

0 comments on commit 2b37232

Please sign in to comment.