diff --git a/src/yunohost/hook.py b/src/yunohost/hook.py index c55a4fd43..49174c183 100644 --- a/src/yunohost/hook.py +++ b/src/yunohost/hook.py @@ -360,12 +360,14 @@ def hook_exec(path, args=None, raise_on_error=False, no_trace=False, # Check and return process' return code if returncode is None: if raise_on_error: - raise MoulinetteError(m18n.n('hook_exec_not_terminated', path=path)) + raise MoulinetteError( + errno.EIO, m18n.n('hook_exec_not_terminated', path=path)) else: logger.error(m18n.n('hook_exec_not_terminated', path=path)) return 1 elif raise_on_error and returncode != 0: - raise MoulinetteError(m18n.n('hook_exec_failed', path=path)) + raise MoulinetteError( + errno.EIO, m18n.n('hook_exec_failed', path=path)) return returncode