[Pkg-privacy-commits] [tails-installer] 04/17: Improve status()' error reporting.

Ulrike Uhlig ulrike at moszumanska.debian.org
Mon Mar 12 14:21:14 UTC 2018


This is an automated email from the git hooks/post-receive script.

ulrike pushed a commit to branch tails/master
in repository tails-installer.

commit cf835c1078b7e9fc5ef38232103c713943fb5793
Author: anonym <anonym at riseup.net>
Date:   Sat Jan 27 10:11:48 2018 +0100

    Improve status()' error reporting.
    
    This way users have a chance to immediately report something useful to
    us in case there's a problem with this function in the future (it
    seems like it, given that there already was some debug logging in
    place.)
---
 tails_installer/gui.py | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/tails_installer/gui.py b/tails_installer/gui.py
index 21e5d27..b2e18cc 100755
--- a/tails_installer/gui.py
+++ b/tails_installer/gui.py
@@ -636,18 +636,23 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
     def progress(self, value):
         self.__progressbar.set_fraction(value)
 
-    def status(self, text):
-        self.live.log.debug("Argument is of type '%(type)s'"
-                            % {'type': type(text).__name__})
-        if isinstance(text, str) or isinstance(text, unicode):
-            pass
-        elif isinstance(text, Exception) \
-           and hasattr(text, 'args') \
-           and type(text.args).__name__ == 'list':
-            text = text.args[0]
-        else:
-            text = str(text)
-        self.append_to_log(text)
+    def status(self, obj):
+        try:
+            if isinstance(obj, str) or isinstance(obj, unicode):
+                text = obj
+            elif isinstance(obj, Exception) \
+                 and hasattr(obj, 'args') \
+                 and type(obj.args).__name__ == 'list':
+                text = obj.args[0]
+            else:
+                text = str(obj)
+            self.append_to_log(text)
+        except Exception as e:
+            self.live.log.exception(
+                "Failed to set status to object of type '{type}'"
+                .format(type=type(obj).__name__)
+            )
+            raise e
 
     def enable_widgets(self, enabled=True):
         if enabled:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git



More information about the Pkg-privacy-commits mailing list