From 4d2c093f4ba1d28ea0dc6a4429d6c5e6b98ba4a4 Mon Sep 17 00:00:00 2001 From: VG Date: Wed, 18 May 2016 15:15:19 +0200 Subject: Use a catch-all for always-on service Errors are displayed on stdout --- climl/imap.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/climl/imap.py b/climl/imap.py index 69e2117..6bdcb04 100644 --- a/climl/imap.py +++ b/climl/imap.py @@ -151,7 +151,12 @@ def main(callback=None): time.sleep(10) # wait between retries except KeyboardInterrupt: break - pass except KeyboardInterrupt: break + except Exception as e: + print('Unhandled exception during connection: ', e) + try: + time.sleep(10) # wait between retries + except KeyboardInterrupt: + break print('end of connection') -- cgit v1.2.3