projects
/
matthijs
/
projects
/
backupninja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
dfad6e1
)
actions: Catch and log exceptions when running handlers.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 10 Jun 2010 06:18:29 +0000
(08:18 +0200)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 10 Jun 2010 06:18:29 +0000
(08:18 +0200)
src/lib/backupninja/action.py
patch
|
blob
|
history
diff --git
a/src/lib/backupninja/action.py
b/src/lib/backupninja/action.py
index 3f57a188f7b9b6a2f171bbb7f4a34442110b2a6b..95c43fd9d940760f0ea990e6dacb6bdb07a6444e 100644
(file)
--- a/
src/lib/backupninja/action.py
+++ b/
src/lib/backupninja/action.py
@@
-21,6
+21,8
@@
""" Running backup actions """
""" Running backup actions """
+import logging as log
+
from backupninja import config
from backupninja import handlers
from backupninja import config
from backupninja import handlers
@@
-53,9
+55,12
@@
def run_action(action, opts, global_config):
# Create a handler for this action
handler = handlers.create_handler(action_ty, action_config)
# Create a handler for this action
handler = handlers.create_handler(action_ty, action_config)
- if handler:
- # Run the handler
- handler.run()
- handler.finish()
# Silently skip invalid handlers, create_handler will have
# logged an error
# Silently skip invalid handlers, create_handler will have
# logged an error
+ if handler:
+ try:
+ # Run the handler
+ handler.run()
+ handler.finish()
+ except Exception, e:
+ log.error('Running action "%s" failed: %s', action, e)