about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-13 21:48:46 +0100
committerhut <hut@lavabit.com>2010-01-13 21:48:46 +0100
commit117028c3337b69f51cc09de2148c7206ee1b96e1 (patch)
tree9270d7479edc1eb9faba1222890ca7d4d8ac26d3
parent698ba46a5a73682a5f9d7832c23683868246841f (diff)
downloadranger-117028c3337b69f51cc09de2148c7206ee1b96e1.tar.gz
Added error handlers for failed commands
-rw-r--r--ranger/gui/ui.py5
-rw-r--r--ranger/gui/widgets/console.py10
-rw-r--r--ranger/gui/widgets/pager.py5
-rw-r--r--ranger/gui/widgets/taskview.py5
4 files changed, 20 insertions, 5 deletions
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index 771f0b2a..c7c4a14b 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -138,7 +138,10 @@ class UI(DisplayableContainer):
 			if hasattr(self, 'hint'):
 				self.hint(cmd.text)
 		elif hasattr(cmd, 'execute'):
-			cmd.execute_wrap(self)
+			try:
+				cmd.execute_wrap(self)
+			except Exception as error:
+				self.fm.notify(error)
 			self.env.key_clear()
 
 	def get_next_key(self):
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 90192bee..6cf00b14 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -123,7 +123,10 @@ class Console(Widget):
 		if cmd == self.commandlist.dummy_object:
 			return
 
-		cmd.execute_wrap(self)
+		try:
+			cmd.execute_wrap(self)
+		except Exception as error:
+			self.fm.notify(error)
 		self.env.key_clear()
 
 	def type_key(self, key):
@@ -265,7 +268,10 @@ class CommandConsole(ConsoleWithTab):
 			cmd = self._get_cmd()
 
 		if cmd:
-			cmd.execute()
+			try:
+				cmd.execute()
+			except Exception as error:
+				self.fm.notify(error)
 
 		Console.execute(self)
 
diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py
index c14e0efb..52de9ccf 100644
--- a/ranger/gui/widgets/pager.py
+++ b/ranger/gui/widgets/pager.py
@@ -170,7 +170,10 @@ class Pager(Widget):
 			self.env.key_clear()
 		else:
 			if hasattr(cmd, 'execute'):
-				cmd.execute_wrap(self)
+				try:
+					cmd.execute_wrap(self)
+				except Exception as error:
+					self.fm.notify(error)
 				self.env.key_clear()
 	
 	def set_source(self, source, strip=False):
diff --git a/ranger/gui/widgets/taskview.py b/ranger/gui/widgets/taskview.py
index 909577d8..a99a567e 100644
--- a/ranger/gui/widgets/taskview.py
+++ b/ranger/gui/widgets/taskview.py
@@ -102,7 +102,10 @@ class TaskView(Widget, Accumulator):
 			self.env.key_clear()
 		else:
 			if hasattr(cmd, 'execute'):
-				cmd.execute_wrap(self)
+				try:
+					cmd.execute_wrap(self)
+				except Exception as error:
+					self.fm.notify(error)
 				self.env.key_clear()
 	
 	def get_list(self):
>
78a7d762 ^
e952d6cb ^
78a7d762 ^
e952d6cb ^
4ea0f69a ^



36e4e71e ^
e952d6cb ^


7582555b ^
e952d6cb ^
36e4e71e ^
e952d6cb ^




36e4e71e ^
e952d6cb ^

36e4e71e ^
306c76d8 ^
e952d6cb ^

306c76d8 ^
e952d6cb ^


306c76d8 ^
e952d6cb ^
306c76d8 ^
e952d6cb ^

45cf5174 ^
e952d6cb ^

45cf5174 ^
b34fd133 ^
e952d6cb ^

45cf5174 ^
e952d6cb ^
45cf5174 ^
e952d6cb ^

45cf5174 ^
e952d6cb ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86