beeminder: Remove duplicated try-except in initialize
method.
Remove duplicated try-except in `initialize` method because ConnectionError is already catched in `get_beeminder_response` method.
This commit is contained in:
parent
f3d2d3a01e
commit
dc83d9e468
|
@ -83,13 +83,9 @@ class BeeminderHandler(object):
|
||||||
def initialize(self, bot_handler: Any) -> None:
|
def initialize(self, bot_handler: Any) -> None:
|
||||||
self.config_info = bot_handler.get_config_info('beeminder')
|
self.config_info = bot_handler.get_config_info('beeminder')
|
||||||
# Check for valid auth_token
|
# Check for valid auth_token
|
||||||
try:
|
result = get_beeminder_response('5', self.config_info)
|
||||||
result = get_beeminder_response('5', self.config_info)
|
if result == "Error. Check your key!":
|
||||||
if result == "Error. Check your key!":
|
bot_handler.quit('Invalid key!')
|
||||||
bot_handler.quit('Invalid key!')
|
|
||||||
except ConnectionError:
|
|
||||||
logging.warning('Bad connection')
|
|
||||||
raise
|
|
||||||
|
|
||||||
def usage(self) -> str:
|
def usage(self) -> str:
|
||||||
return "This plugin allows users to add datapoints towards their Beeminder goals"
|
return "This plugin allows users to add datapoints towards their Beeminder goals"
|
||||||
|
|
Loading…
Reference in a new issue