diff options
| author | 2021-01-26 18:06:32 +0200 | |
|---|---|---|
| committer | 2021-01-26 18:06:32 +0200 | |
| commit | f23c2e78fb9ac6e6c2f7faeaeaf652c89ad8c263 (patch) | |
| tree | 3f927a99c5e02b4748e1efaf03a1e83c6ac61fbc | |
| parent | Added defcon status notifier (diff) | |
Make the cog update even if write to DB fails
The defcon cog should be functional even if there is some issue with writing to the DB for some reason. The functionality should have retention across restarts, but it shouldn't be its failing point. If necessary, it should be able to work with no DB at all
| -rw-r--r-- | bot/exts/moderation/defcon.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/moderation/defcon.py b/bot/exts/moderation/defcon.py index 4b25c36df..00b108feb 100644 --- a/bot/exts/moderation/defcon.py +++ b/bot/exts/moderation/defcon.py @@ -157,13 +157,13 @@ class Defcon(Cog): } ) - self.days = timedelta(days=days) - self.update_notifier() - except Exception as err: log.exception("Unable to update DEFCON settings.") error = err finally: + self.days = timedelta(days=days) + self.update_notifier() + await ctx.send(self.build_defcon_msg(action, error)) await self.send_defcon_log(action, ctx.author, error) |