Skip to content

Commit

Permalink
feat: add Exception class name in err messages
Browse files Browse the repository at this point in the history
Easier debugging: some Python exception error messages are difficult to
interpret without the exception type (e.g. KeyError).
  • Loading branch information
nojhan committed Mar 4, 2021
1 parent 3a63926 commit 5fb7466
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions terminatorlib/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def __init__(self):
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)
Expand Down Expand Up @@ -387,7 +387,7 @@ def update_url_matches(self):
(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"""
Expand Down Expand Up @@ -1528,7 +1528,7 @@ def prepare_url(self, urlmatch):
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

Expand Down

0 comments on commit 5fb7466

Please sign in to comment.