From 5fb74661287503abfbd9e2c8e62c58ee6b99cbbc Mon Sep 17 00:00:00 2001 From: nojhan Date: Sun, 14 Feb 2021 19:32:57 +0100 Subject: [PATCH] feat: add Exception class name in err messages Easier debugging: some Python exception error messages are difficult to interpret without the exception type (e.g. KeyError). --- terminatorlib/terminal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index c76cd9a8..c49f6ad2 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -175,7 +175,7 @@ class Terminal(Gtk.VBox): except Exception as e: self.background_image = None self.vte.set_clear_background(True) - err('error loading background image: %s' % e) + err('error loading background image: %s, %s' % (type(ex).__name__,e)) self.background_alpha = self.config['background_darkness'] self.vte.set_allow_hyperlink(True) @@ -387,7 +387,7 @@ class Terminal(Gtk.VBox): (name, urlplugin.__class__.__name__, self.matches[name])) except Exception as ex: - err('Exception occurred adding plugin URL match: %s' % ex) + err('Exception occurred adding plugin URL match: %s, %s' % (type(ex).__name__, ex)) def match_add(self, name, match): """Register a URL match""" @@ -1528,7 +1528,7 @@ class Terminal(Gtk.VBox): url = newurl break except Exception as ex: - err('Exception occurred preparing URL: %s' % ex) + err('Exception occurred preparing URL: %s, %s' % (type(ex).__name__, ex)) return url