mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Raise proper MoulinetteError exception in hook_exec
This commit is contained in:
parent
81c8ce1a54
commit
048ed3b0ea
1 changed files with 4 additions and 2 deletions
|
@ -360,12 +360,14 @@ def hook_exec(path, args=None, raise_on_error=False, no_trace=False,
|
||||||
# Check and return process' return code
|
# Check and return process' return code
|
||||||
if returncode is None:
|
if returncode is None:
|
||||||
if raise_on_error:
|
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:
|
else:
|
||||||
logger.error(m18n.n('hook_exec_not_terminated', path=path))
|
logger.error(m18n.n('hook_exec_not_terminated', path=path))
|
||||||
return 1
|
return 1
|
||||||
elif raise_on_error and returncode != 0:
|
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
|
return returncode
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue