diff options
author | hut <hut@lavabit.com> | 2010-01-11 00:02:53 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-01-11 00:02:53 +0100 |
commit | be868b98c41dac9e588944ece0d8c70e3eee534a (patch) | |
tree | 231fecae645a79f164e0187dc3594df4e1d40f8b /ranger | |
parent | 2854025366dee829562dabfa50c8c1e85181049e (diff) | |
download | ranger-be868b98c41dac9e588944ece0d8c70e3eee534a.tar.gz |
actions: added an easier way to display errors
just write fm.notify(your_exception).
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/actions.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ranger/actions.py b/ranger/actions.py index 7e1c1dd3..48db860c 100644 --- a/ranger/actions.py +++ b/ranger/actions.py @@ -338,6 +338,9 @@ class Actions(EnvironmentAware, SettingsAware): pass def notify(self, text, duration=4, bad=False): + if isinstance(text, Exception): + text = str(text) + bad = True self.log.appendleft(text) if hasattr(self.ui, 'notify'): self.ui.notify(text, duration=duration, bad=bad) |