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).
This commit is contained in:
nojhan 2021-02-14 19:32:57 +01:00
parent 3a6392668d
commit 5fb7466128
1 changed files with 3 additions and 3 deletions

View File

@ -175,7 +175,7 @@ class Terminal(Gtk.VBox):
except Exception as e: except Exception as e:
self.background_image = None self.background_image = None
self.vte.set_clear_background(True) 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.background_alpha = self.config['background_darkness']
self.vte.set_allow_hyperlink(True) self.vte.set_allow_hyperlink(True)
@ -387,7 +387,7 @@ class Terminal(Gtk.VBox):
(name, urlplugin.__class__.__name__, (name, urlplugin.__class__.__name__,
self.matches[name])) self.matches[name]))
except Exception as ex: 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): def match_add(self, name, match):
"""Register a URL match""" """Register a URL match"""
@ -1528,7 +1528,7 @@ class Terminal(Gtk.VBox):
url = newurl url = newurl
break break
except Exception as ex: except Exception as ex:
err('Exception occurred preparing URL: %s' % ex) err('Exception occurred preparing URL: %s, %s' % (type(ex).__name__, ex))
return url return url