From 5ce85ca915bc63a08e82857a445c1866ca3abf85 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 31 Oct 2013 16:48:04 -0200 Subject: improve error handling --- src/leap/bitmask/services/mail/imap.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/leap/bitmask/services/mail/imap.py') diff --git a/src/leap/bitmask/services/mail/imap.py b/src/leap/bitmask/services/mail/imap.py index 4828180e..2667f156 100644 --- a/src/leap/bitmask/services/mail/imap.py +++ b/src/leap/bitmask/services/mail/imap.py @@ -41,9 +41,10 @@ def get_mail_check_period(): try: period = int(period_str) except (ValueError, TypeError): - logger.warning("BAD value found for %s: %s" % ( - INCOMING_CHECK_PERIOD_ENV, - period_str)) + if period is not None: + logger.warning("BAD value found for %s: %s" % ( + INCOMING_CHECK_PERIOD_ENV, + period_str)) except Exception as exc: logger.warning("Unhandled error while getting %s: %r" % ( INCOMING_CHECK_PERIOD_ENV, -- cgit v1.2.3