diff --git a/src/yunohost/log.py b/src/yunohost/log.py index 77f20795a..440a454fb 100644 --- a/src/yunohost/log.py +++ b/src/yunohost/log.py @@ -248,6 +248,9 @@ def is_unit_operation(entities='app,domain,service,user', exclude='auth,password if not auto: args = (uo,) + args result = func(*args, **kwargs) + except Exception as e: + uo.error(e) + raise e finally: # Close the unit operation if it hasn't been closed before uo.close(exc_info()[0])