mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Display hook path on error message.
This commit is contained in:
parent
f176c3061e
commit
7999293438
2 changed files with 5 additions and 5 deletions
|
@ -94,8 +94,8 @@
|
|||
|
||||
"hook_list_by_invalid" : "Invalid property to list hook by",
|
||||
"hook_name_unknown" : "Unknown hook name '{:s}'",
|
||||
"hook_exec_failed" : "Script execution failed",
|
||||
"hook_exec_not_terminated" : "Script execution hasn’t terminated",
|
||||
"hook_exec_failed" : "Script execution failed: {path:s}",
|
||||
"hook_exec_not_terminated" : "Script execution hasn’t terminated: {path:s}",
|
||||
|
||||
"mountpoint_unknown" : "Unknown mountpoint",
|
||||
"unit_unknown" : "Unknown unit '{:s}'",
|
||||
|
|
|
@ -330,12 +330,12 @@ 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'))
|
||||
raise MoulinetteError(m18n.n('hook_exec_not_terminated', path=path))
|
||||
else:
|
||||
logger.error(m18n.n('hook_exec_not_terminated'))
|
||||
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'))
|
||||
raise MoulinetteError(m18n.n('hook_exec_failed', path=path))
|
||||
return returncode
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue