diff piecrust/data/pagedata.py @ 711:ab5c6a8ae90a

bake: Replace hard-coded taxonomy support with "generator" system. * Taxonomies are now implemented one or more `TaxonomyGenerator`s. * A `BlogArchivesGenerator` stub is there but non-functional.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 26 May 2016 19:52:47 -0700
parents 785dea918ad8
children aed8a860c1d0
line wrap: on
line diff
--- a/piecrust/data/pagedata.py	Thu May 26 19:46:28 2016 -0700
+++ b/piecrust/data/pagedata.py	Thu May 26 19:52:47 2016 -0700
@@ -1,7 +1,11 @@
 import time
+import logging
 import collections.abc
 
 
+logger = logging.getLogger(__name__)
+
+
 class LazyPageConfigLoaderHasNoValue(Exception):
     """ An exception that can be returned when a loader for `LazyPageConfig`
         can't return any value.
@@ -29,12 +33,14 @@
         try:
             return self._getValue(name)
         except LazyPageConfigLoaderHasNoValue as ex:
+            logger.exception(ex)
             raise AttributeError("No such attribute: %s" % name) from ex
 
     def __getitem__(self, name):
         try:
             return self._getValue(name)
         except LazyPageConfigLoaderHasNoValue as ex:
+            logger.exception(ex)
             raise KeyError("No such key: %s" % name) from ex
 
     def __iter__(self):
@@ -69,6 +75,7 @@
             except LazyPageConfigLoaderHasNoValue:
                 raise
             except Exception as ex:
+                logger.exception(ex)
                 raise Exception(
                         "Error while loading attribute '%s' for: %s" %
                         (name, self._page.rel_path)) from ex
@@ -88,6 +95,7 @@
             except LazyPageConfigLoaderHasNoValue:
                 raise
             except Exception as ex:
+                logger.exception(ex)
                 raise Exception(
                         "Error while loading attribute '%s' for: %s" %
                         (name, self._page.rel_path)) from ex
@@ -125,6 +133,7 @@
         try:
             self._load()
         except Exception as ex:
+            logger.exception(ex)
             raise Exception(
                     "Error while loading data for: %s" %
                     self._page.rel_path) from ex