From 2e2c296899e95f196303a8186bc3d520e35ad3fe Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 3 Oct 2012 17:14:50 -0400 Subject: [PATCH] api: Cut down a bit on the error handling verbosity. (imported from commit b665b939f8474f0d631125ecd7c3d300e338ff3c) --- common.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common.py b/common.py index 71efad1..d7b47de 100644 --- a/common.py +++ b/common.py @@ -42,14 +42,16 @@ class HumbugAPI(): # 502/503 typically means the server was restarted; sleep # a bit, then try again if self.verbose: - print "HTTP Error getting zephyrs; trying again soon." print e - print traceback.format_exc() + print "Error getting zephyrs (probably server restart); retrying..." time.sleep(1) continue except Exception, e: # For other errors, just try again - print e + if self.verbose: + print e + print traceback.format_exc() + print "Unexpected error! You should send Tim the above traceback. Retrying..." time.sleep(2) continue for message in sorted(messages, key=lambda x: x["id"]):