From 1ff16f248b67cb6188c6b2127c03808e0a1e6cd0 Mon Sep 17 00:00:00 2001 From: David Beitey Date: Thu, 21 Mar 2013 15:44:52 +1000 Subject: [PATCH] Raise exceptions from the autoreload loop if debug is enabled --- docs/changelog.rst | 2 ++ pelican/__init__.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index aa18ea9e..f9c315ac 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,6 +5,8 @@ Release history ================ * Support for Python 3! +* Ensure exceptions are raised if they take place during processing + with autoreload enabled with debug enabled. 3.1 (2012-12-04) ================ diff --git a/pelican/__init__.py b/pelican/__init__.py index 0e3db788..0e9bfb67 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -326,6 +326,9 @@ def main(): files_found_error = False time.sleep(1) # sleep to avoid cpu load except Exception as e: + if (args.verbosity == logging.DEBUG): + logger.critical(e.args) + raise logger.warning( 'Caught exception "{0}". Reloading.'.format(e)) continue