summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-11 00:02:53 +0100
committerhut <hut@lavabit.com>2010-01-11 00:02:53 +0100
commitbe868b98c41dac9e588944ece0d8c70e3eee534a (patch)
tree231fecae645a79f164e0187dc3594df4e1d40f8b
parent2854025366dee829562dabfa50c8c1e85181049e (diff)
downloadranger-be868b98c41dac9e588944ece0d8c70e3eee534a.tar.gz
actions: added an easier way to display errors
just write fm.notify(your_exception).
-rw-r--r--ranger/actions.py3
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)