fix(aurora); log when Modereation.execute() fails with an operationalerror
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Failing after 27s
Actions / Lint Code (Ruff & Pylint) (pull_request) Successful in 41s

This commit is contained in:
Seaswimmer 2024-08-10 13:32:37 -04:00
parent 49cf7c9005
commit 14dc256919
Signed by: cswimr
GPG key ID: 3813315477F26F82

View file

@ -289,7 +289,12 @@ class Moderation(AuroraGuildModel):
else:
no_cursor = False
try:
await cursor.execute(query, parameters)
except OperationalError as e:
logger.error("Error executing query: \"%s\" with parameters \"%s\"\nError:\n%s",
query, parameters, e)
raise OperationalError(f"Error executing query: \"{query}\" with parameters \"{parameters}\"") from e
results = await cursor.fetchall()
await database.commit()
if no_cursor: