mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fixes #1405: No error message for invalid syntax in period_archives.html
This commit is contained in:
parent
cb11bea1f2
commit
304b16a9be
1 changed files with 5 additions and 2 deletions
|
|
@ -29,6 +29,9 @@ from pelican import signals
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PelicanTemplateNotFound(Exception):
|
||||
pass
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Generator(object):
|
||||
"""Baseclass generator"""
|
||||
|
|
@ -88,7 +91,7 @@ class Generator(object):
|
|||
try:
|
||||
self._templates[name] = self.env.get_template(name + '.html')
|
||||
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))
|
||||
return self._templates[name]
|
||||
|
||||
|
|
@ -330,7 +333,7 @@ class ArticlesGenerator(CachingGenerator):
|
|||
"""Generate per-year, per-month, and per-day archives."""
|
||||
try:
|
||||
template = self.get_template('period_archives')
|
||||
except Exception:
|
||||
except PelicanTemplateNotFound:
|
||||
template = self.get_template('archives')
|
||||
|
||||
period_save_as = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue