##// END OF EJS Templates
dispatch: split global error handling out so it can be reused...
Jun Wu -
r29761:39149b60 default
parent child Browse files
Show More
@@ -150,7 +150,7 b' def _runcatch(req):'
150 except ValueError:
150 except ValueError:
151 pass # happens if called in a thread
151 pass # happens if called in a thread
152
152
153 try:
153 def _runcatchfunc():
154 try:
154 try:
155 debugger = 'pdb'
155 debugger = 'pdb'
156 debugtrace = {
156 debugtrace = {
@@ -212,6 +212,16 b' def _runcatch(req):'
212 ui.traceback()
212 ui.traceback()
213 raise
213 raise
214
214
215 return callcatch(ui, _runcatchfunc)
216
217 def callcatch(ui, func):
218 """call func() with global exception handling
219
220 return func() if no exception happens. otherwise do some error handling
221 and return an exit code accordingly.
222 """
223 try:
224 return func()
215 # Global exception handling, alphabetically
225 # Global exception handling, alphabetically
216 # Mercurial-specific first, followed by built-in and library exceptions
226 # Mercurial-specific first, followed by built-in and library exceptions
217 except error.AmbiguousCommand as inst:
227 except error.AmbiguousCommand as inst:
@@ -91,6 +91,8 b''
91 */mercurial/dispatch.py:* in run (glob)
91 */mercurial/dispatch.py:* in run (glob)
92 */mercurial/dispatch.py:* in dispatch (glob)
92 */mercurial/dispatch.py:* in dispatch (glob)
93 */mercurial/dispatch.py:* in _runcatch (glob)
93 */mercurial/dispatch.py:* in _runcatch (glob)
94 */mercurial/dispatch.py:* in callcatch (glob)
95 */mercurial/dispatch.py:* in _runcatchfunc (glob)
94 */mercurial/dispatch.py:* in _dispatch (glob)
96 */mercurial/dispatch.py:* in _dispatch (glob)
95 */mercurial/dispatch.py:* in runcommand (glob)
97 */mercurial/dispatch.py:* in runcommand (glob)
96 */mercurial/dispatch.py:* in _runcommand (glob)
98 */mercurial/dispatch.py:* in _runcommand (glob)
@@ -125,6 +127,8 b''
125 */mercurial/dispatch.py:* in run (glob)
127 */mercurial/dispatch.py:* in run (glob)
126 */mercurial/dispatch.py:* in dispatch (glob)
128 */mercurial/dispatch.py:* in dispatch (glob)
127 */mercurial/dispatch.py:* in _runcatch (glob)
129 */mercurial/dispatch.py:* in _runcatch (glob)
130 */mercurial/dispatch.py:* in callcatch (glob)
131 */mercurial/dispatch.py:* in _runcatchfunc (glob)
128 */mercurial/dispatch.py:* in _dispatch (glob)
132 */mercurial/dispatch.py:* in _dispatch (glob)
129 */mercurial/dispatch.py:* in runcommand (glob)
133 */mercurial/dispatch.py:* in runcommand (glob)
130 */mercurial/dispatch.py:* in _runcommand (glob)
134 */mercurial/dispatch.py:* in _runcommand (glob)
@@ -147,6 +151,8 b''
147 */mercurial/dispatch.py:* in run (glob)
151 */mercurial/dispatch.py:* in run (glob)
148 */mercurial/dispatch.py:* in dispatch (glob)
152 */mercurial/dispatch.py:* in dispatch (glob)
149 */mercurial/dispatch.py:* in _runcatch (glob)
153 */mercurial/dispatch.py:* in _runcatch (glob)
154 */mercurial/dispatch.py:* in callcatch (glob)
155 */mercurial/dispatch.py:* in _runcatchfunc (glob)
150 */mercurial/dispatch.py:* in _dispatch (glob)
156 */mercurial/dispatch.py:* in _dispatch (glob)
151 */mercurial/dispatch.py:* in runcommand (glob)
157 */mercurial/dispatch.py:* in runcommand (glob)
152 */mercurial/dispatch.py:* in _runcommand (glob)
158 */mercurial/dispatch.py:* in _runcommand (glob)
General Comments 0
You need to be logged in to leave comments. Login now