Fixes #1405: No error message for invalid syntax in period_archives.html

This commit is contained in:
Artemy Tregubenko 2014-08-31 09:55:45 +02:00
commit 304b16a9be

View file

@ -29,6 +29,9 @@ from pelican import signals
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class PelicanTemplateNotFound(Exception):
pass
@python_2_unicode_compatible @python_2_unicode_compatible
class Generator(object): class Generator(object):
"""Baseclass generator""" """Baseclass generator"""
@ -88,7 +91,7 @@ class Generator(object):
try: try:
self._templates[name] = self.env.get_template(name + '.html') self._templates[name] = self.env.get_template(name + '.html')
except TemplateNotFound: except TemplateNotFound:
raise Exception('[templates] unable to load %s.html from %s' raise PelicanTemplateNotFound('[templates] unable to load %s.html from %s'
% (name, self._templates_path)) % (name, self._templates_path))
return self._templates[name] return self._templates[name]
@ -330,7 +333,7 @@ class ArticlesGenerator(CachingGenerator):
"""Generate per-year, per-month, and per-day archives.""" """Generate per-year, per-month, and per-day archives."""
try: try:
template = self.get_template('period_archives') template = self.get_template('period_archives')
except Exception: except PelicanTemplateNotFound:
template = self.get_template('archives') template = self.get_template('archives')
period_save_as = { period_save_as = {