fix logger giving out database error, and announce error as non ephemeral

This commit is contained in:
Philipp 2022-10-06 15:30:02 +02:00 committed by Gitea
parent eb263227fd
commit 64e4572e73
Signed by: Forgejo
GPG key ID: 5A09F9506519E10A

View file

@ -91,8 +91,8 @@ def main(args):
logger.debug(f"{user.id} with SteamID: {steam_id.steam2(1)} has just claimed a reserved slot.") logger.debug(f"{user.id} with SteamID: {steam_id.steam2(1)} has just claimed a reserved slot.")
except Exception as err: except Exception as err:
if str(err) != "Duplicate entrys": if str(err) != "Duplicate entrys":
await ctx.send(f"Something failed with the database, please try again later.", ephemeral=True) await ctx.send(f"Something failed with the database, please try again later.")
logger.warning(f"Error while trying to access database.", err) logger.warning(f"Error while trying to access database. {err}")
return return
await ctx.send(f"You have already claimed a reserved slot!", ephemeral=True) await ctx.send(f"You have already claimed a reserved slot!", ephemeral=True)
logger.debug(f"{steam_id.steam2(1)} or User {user.username} ({user.id}) is already in the database.") logger.debug(f"{steam_id.steam2(1)} or User {user.username} ({user.id}) is already in the database.")