giphy bot: Use bot_handler.quit().
This commit is contained in:
parent
299d04080e
commit
ba530e2341
|
@ -32,9 +32,8 @@ class GiphyHandler(object):
|
||||||
data = requests.get(GIPHY_TRANSLATE_API, params=query)
|
data = requests.get(GIPHY_TRANSLATE_API, params=query)
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
if (e.response.json()['error']['errors'][0]['reason'] == 'keyInvalid'):
|
if (e.response.json()['error']['errors'][0]['reason'] == 'keyInvalid'):
|
||||||
logging.error('Invalid key.'
|
bot_handler.quit('Invalid key.'
|
||||||
'Follow the instructions in doc.md for setting API key.')
|
'Follow the instructions in doc.md for setting API key.')
|
||||||
sys.exit(1)
|
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
|
|
Loading…
Reference in a new issue