From: Sapan Bhatia Date: Mon, 28 Apr 2014 17:07:18 +0000 (-0400) Subject: This patch logs exceptions in the core of the Observer, which might X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=5b2f502d990fa91a975c98d508d94543135b233c;p=plstackapi.git This patch logs exceptions in the core of the Observer, which might occur in case of a misconfiguration or in case there's an Observer bug. --- diff --git a/planetstack/observer/event_loop.py b/planetstack/observer/event_loop.py index 6b77236..1859468 100644 --- a/planetstack/observer/event_loop.py +++ b/planetstack/observer/event_loop.py @@ -249,7 +249,9 @@ class PlanetStackObserver: except StepNotReady: logging.info('Step not ready: %s'%sync_step.__name__) failed_steps.append(sync_step) - except: + except Exception,e: + logging.error('%r',e) + logger.log_exc("sync step failed: %r!"%sync_step) failed_steps.append(sync_step) if (should_run): @@ -268,9 +270,12 @@ class PlanetStackObserver: if failed_objects: failed_step_objects.update(failed_objects) self.update_run_time(sync_step) - except: + except Exception,e: + logging.error('Model step failed. This seems like a misconfiguration or bug: %r',e) + logger.log_exc(e) failed_steps.append(S) self.save_run_times() - except: + except Exception, e: + logging.error('Core error. This seems like a misconfiguration or bug: %r',e) logger.log_exc("Exception in observer run loop") traceback.print_exc()