commit:     e5c7b9e292c81c74c6b016aa03ef76214515f0bd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  6 08:03:48 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov  6 20:05:27 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5c7b9e2

emaint: log FileCopier exceptions

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 <zmedico <AT> 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 ca573fa49..0441fc677 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)

Reply via email to