summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@gmail.com>2012-04-22 16:13:39 -0700
committerDoug Hellmann <doug.hellmann@gmail.com>2012-04-22 16:13:39 -0700
commit267c7593591aa58bbf30c94b5db811a6df8d620a (patch)
tree4ebd8c029d7fd6cb83344a207e665584ab25556b
parent6fdfe6dbf193e917388847a6baa95faa34b28c76 (diff)
downloadcliff-tablib-267c7593591aa58bbf30c94b5db811a6df8d620a.tar.gz
better error handling of post-action hook in app
-rw-r--r--cliff/app.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/cliff/app.py b/cliff/app.py
index c7082a5..a51c7e1 100644
--- a/cliff/app.py
+++ b/cliff/app.py
@@ -150,7 +150,13 @@ class App(object):
if self.options.debug:
LOG.exception(err)
raise
- LOG.error(err)
+ LOG.error('ERROR: %s', err)
finally:
- self.clean_up(cmd, result, err)
+ try:
+ self.clean_up(cmd, result, err)
+ except Exception as err2:
+ if self.options.debug:
+ LOG.exception(err2)
+ else:
+ LOG.error('Could not clean up: %s', err2)
return result