summaryrefslogtreecommitdiff
path: root/morphlib/app.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-04-16 15:57:58 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-04-16 16:03:23 +0100
commit6375554363c111fda70b7540c3c56a0e9cf1497b (patch)
tree46cd93eda94aa5009dc8626949e23658fb8e4962 /morphlib/app.py
parente7e90384da00a8197c5e0363a5a4005754a790eb (diff)
downloadmorph-6375554363c111fda70b7540c3c56a0e9cf1497b.tar.gz
Stop using bare except: statements
It is almost never a good idea to catch all exceptions, and then do nothing about them. This patch logs all caught exceptions so that the user has some possibilty to debug what is happening. Also, make ./check check for bare excepts and fail the test suite if it finds anything.
Diffstat (limited to 'morphlib/app.py')
-rwxr-xr-xmorphlib/app.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/morphlib/app.py b/morphlib/app.py
index 859019f9..1d4d6fb0 100755
--- a/morphlib/app.py
+++ b/morphlib/app.py
@@ -253,8 +253,8 @@ class Morph(cliapp.Application):
reponame=reponame,
ref=ref,
chatty=True)
- except:
- pass
+ except BaseException, e:
+ logging.warning('Caught (and ignored) exception: %s' % str(e))
if absref is None:
if update:
self.status(msg='Caching git repository %(reponame)s',