From 1a705c2b6c87476d79d50c0664d4280f9699f2b8 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 27 Mar 2022 14:56:56 -0400 Subject: [PATCH] KeyError instead of NameError ~507 bot.py --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 9cff56c..a5e6430 100644 --- a/bot.py +++ b/bot.py @@ -504,7 +504,7 @@ class Bot(commands.Bot): self.squelch = float(config[self.profile_name]['Squelch']) try: self.noisegate_sensitivity = int(config[self.profile_name]['Noisegate Sensitivity']) - except NameError as err: + except KeyError as err: print(f"Config does not contain a 'noisegate sensitivity' value, " f"creating one now with the default value: {BotResources.DEFAULT_NOISEGATE_THRESHOLD}") self.noisegate_sensitivity = BotResources.DEFAULT_NOISEGATE_THRESHOLD