1
0
Fork 0

Log exceptions.

This commit is contained in:
Casper V. Kristensen 2020-02-17 03:29:12 +01:00
parent c70ed692e4
commit 7af94add96
Signed by: caspervk
GPG key ID: 289CA03790535054

View file

@ -30,16 +30,20 @@ def listen_inbox() -> None:
def main() -> None:
print(f"Starting Daily Releases Bot v{__version__}")
mode = CONFIG["main"]["mode"]
logger.info("Mode is %s", mode)
try:
print(f"Starting Daily Releases Bot v{__version__}")
mode = CONFIG["main"]["mode"]
logger.info("Mode is %s", mode)
if mode == "test":
generate(post=False)
if mode == "immediately":
generate(post=True, pm_recipients=CONFIG["reddit"]["notify_users"].split(","))
if mode == "reply":
listen_inbox()
if mode == "test":
generate(post=False)
if mode == "immediately":
generate(post=True, pm_recipients=CONFIG["reddit"]["notify_users"].split(","))
if mode == "reply":
listen_inbox()
except Exception as e:
logger.exception(e)
raise e
if __name__ == '__main__':