Since FileCopier now captures exceptions instead of showing
a traceback, it's necessary to explicitly log them.

Bug: https://bugs.gentoo.org/699400
Signed-off-by: Zac Medico <zmed...@gentoo.org>
---
 lib/portage/_emirrordist/DeletionTask.py | 2 +-
 lib/portage/_emirrordist/FetchTask.py    | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/portage/_emirrordist/DeletionTask.py 
b/lib/portage/_emirrordist/DeletionTask.py
index 2fdafd59e..5eb01d840 100644
--- a/lib/portage/_emirrordist/DeletionTask.py
+++ b/lib/portage/_emirrordist/DeletionTask.py
@@ -85,7 +85,7 @@ class DeletionTask(CompositeTask):
 
                else:
                        logging.error(("%s copy from distfiles "
-                               "to recycle failed") % (self.distfile,))
+                               "to recycle failed: %s") % (self.distfile, 
copier.future.exception()))
                        success = False
 
                if success:
diff --git a/lib/portage/_emirrordist/FetchTask.py 
b/lib/portage/_emirrordist/FetchTask.py
index 6f547d397..61812ab59 100644
--- a/lib/portage/_emirrordist/FetchTask.py
+++ b/lib/portage/_emirrordist/FetchTask.py
@@ -372,8 +372,8 @@ class FetchTask(CompositeTask):
 
                current_mirror = self._current_mirror
                if copier.returncode != os.EX_OK:
-                       msg = "%s %s copy failed unexpectedly" % \
-                               (self.distfile, current_mirror.name)
+                       msg = "%s %s copy failed unexpectedly: %s" % \
+                               (self.distfile, current_mirror.name, 
copier.future.exception())
                        self.scheduler.output(msg + '\n', background=True,
                                log_path=self._log_path)
                        logging.error(msg)
@@ -549,8 +549,8 @@ class FetchTask(CompositeTask):
                        self._make_layout_links()
                else:
                        # out of space?
-                       msg = "%s %s copy failed unexpectedly" % \
-                               (self.distfile, self._fetch_tmp_dir_info)
+                       msg = "%s %s copy failed unexpectedly: %s" % \
+                               (self.distfile, self._fetch_tmp_dir_info, 
copier.future.exception())
                        self.scheduler.output(msg + '\n', background=True,
                                log_path=self._log_path)
                        logging.error(msg)
-- 
2.21.0


Reply via email to