getpelican/pelican — pull request #1453 by arty-name (2014-08-31 08:04:52+00:00)
Title: Fixes #1405: No error message for invalid syntax in period_archives.html

#1405 resulted from the wrapping of TemplateNotFound in generic Exception to adjust the error message. After that it was not possible to distinguish any other exception from TemplateNotFound exception.

I have introduced a new PelicanTemplateNotFound exception and started using it to wrap jinja2.TemplateNotFound and to fallback from period_archives to archives.

Another possible approach is not to wrap exception in this case when we want to throw it away. This could be achieved by either parametrising get_template or by extracting get_template_without_wrapping into a separate function. Both seem to me clumsier compared to the approach I have chosen.