handle exceptions in callbacks

This commit is contained in:
lilydjwg 2013-09-05 11:38:39 +08:00
parent 4f9001cea4
commit cca8a27ef9

View file

@ -194,7 +194,10 @@ class RepoMan:
del actiondict[act.name]
else:
# take the later action, but record the former
actiondict[act.name].callback(state=0)
try:
actiondict[act.name].callback(state=0)
except:
logger.exception('failed to run action %r.', actiondict[act.name])
actiondict[act.name] = act
toadd = [(x.path, x.callback) for x in actiondict.values() if x.action == 'add']
toremove = [(x.name, x.callback) for x in actiondict.values() if x.action == 'remove']