summaryrefslogtreecommitdiffstats
path: root/nikola/plugins/misc
diff options
context:
space:
mode:
Diffstat (limited to 'nikola/plugins/misc')
-rw-r--r--nikola/plugins/misc/__init__.py2
-rw-r--r--nikola/plugins/misc/scan_posts.py28
2 files changed, 18 insertions, 12 deletions
diff --git a/nikola/plugins/misc/__init__.py b/nikola/plugins/misc/__init__.py
index c0d8961..518fac1 100644
--- a/nikola/plugins/misc/__init__.py
+++ b/nikola/plugins/misc/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2015 Roberto Alsina and others.
+# Copyright © 2012-2016 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/misc/scan_posts.py b/nikola/plugins/misc/scan_posts.py
index 9db4533..f584a05 100644
--- a/nikola/plugins/misc/scan_posts.py
+++ b/nikola/plugins/misc/scan_posts.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2015 Roberto Alsina and others.
+# Copyright © 2012-2016 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -35,6 +35,8 @@ from nikola.plugin_categories import PostScanner
from nikola import utils
from nikola.post import Post
+LOGGER = utils.get_logger('scan_posts', utils.STDERR_HANDLER)
+
class ScanPosts(PostScanner):
"""Scan posts in the site."""
@@ -87,15 +89,19 @@ class ScanPosts(PostScanner):
continue
else:
seen.add(base_path)
- post = Post(
- base_path,
- self.site.config,
- dest_dir,
- use_in_feeds,
- self.site.MESSAGES,
- template_name,
- self.site.get_compiler(base_path)
- )
- timeline.append(post)
+ try:
+ post = Post(
+ base_path,
+ self.site.config,
+ dest_dir,
+ use_in_feeds,
+ self.site.MESSAGES,
+ template_name,
+ self.site.get_compiler(base_path)
+ )
+ timeline.append(post)
+ except Exception as err:
+ LOGGER.error('Error reading post {}'.format(base_path))
+ raise err
return timeline