[fix] Collect the last error for uo log

This commit is contained in:
ljf 2018-06-05 00:32:28 +02:00
parent f64f0acb5b
commit 9eee035a8d

View file

@ -248,6 +248,9 @@ def is_unit_operation(entities='app,domain,service,user', exclude='auth,password
if not auto: if not auto:
args = (uo,) + args args = (uo,) + args
result = func(*args, **kwargs) result = func(*args, **kwargs)
except Exception as e:
uo.error(e)
raise e
finally: finally:
# Close the unit operation if it hasn't been closed before # Close the unit operation if it hasn't been closed before
uo.close(exc_info()[0]) uo.close(exc_info()[0])