changeset 434:6238dcfc7a78

reporting: Print errors that occured during pipeline processing.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 27 Jun 2015 21:47:48 -0700
parents 5be275137056
children 5ceb86818dc5
files piecrust/processing/pipeline.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/processing/pipeline.py	Sat Jun 27 21:47:22 2015 -0700
+++ b/piecrust/processing/pipeline.py	Sat Jun 27 21:47:48 2015 -0700
@@ -121,11 +121,16 @@
             entry.flags |= res.flags
             entry.proc_tree = res.proc_tree
             entry.rel_outputs = res.rel_outputs
+            if entry.flags & FLAG_PROCESSED:
+                record.current.processed_count += 1
             if res.errors:
                 entry.errors += res.errors
                 record.current.success = False
-            if entry.flags & FLAG_PROCESSED:
-                record.current.processed_count += 1
+
+                rel_path = os.path.relpath(res.path, self.app.root_dir)
+                logger.error("Errors found in %s:" % rel_path)
+                for e in entry.errors:
+                    logger.error("  " + e)
 
         pool = self._createWorkerPool()
         expected_result_count = self._process(src_dir_or_file, pool, record)