From 70ed05625fe1903dafc176e53a98839c240c41ce Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 11 Jul 2012 20:30:56 -0700 Subject: [PATCH 1/2] 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: From 3c5f6e188769be378f7b824f8e5e6b1cfb162241 Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 11 Jul 2012 21:04:01 -0700 Subject: [PATCH 2/2] Inconsistent warning/error, pages failing switched to warning. Fixes #397 --- pelican/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 8526a56d..295be529 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -368,7 +368,7 @@ class PagesGenerator(Generator): try: content, metadata = read_file(f) except Exception, e: - logger.error(u'Could not process %s\n%s' % (f, str(e))) + logger.warning(u'Could not process %s\n%s' % (f, str(e))) continue page = Page(content, metadata, settings=self.settings, filename=f)