From 70ed05625fe1903dafc176e53a98839c240c41ce Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 11 Jul 2012 20:30:56 -0700 Subject: [PATCH] Catch and report exceptions in Auto-reload Fixes #399 Also updated the keyboard interrupt to report before quit. --- pelican/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pelican/__init__.py b/pelican/__init__.py index d42526a3..77db7498 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -258,7 +258,13 @@ def main(): time.sleep(.5) # sleep to avoid cpu load except KeyboardInterrupt: + logger.warning("Keyboard interrupt, quitting.") break + except Exception, e: + logger.warning( + "Caught exception \"{}\". Reloading.".format(e) + ) + continue else: pelican.run() except Exception, e: