When we call an hook we should not exit with the error code.
Instead we should return the code to the function that called that hook function.
So we candle handle errors better.
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
${EXIT_COMMAND_NOT_FOUND}|${EXIT_NOT_SUPPORTED})
log ERROR "Hook '${hook}' does not implement the method '${cmd}':"
log ERROR " arguments: $@"
- exit ${EXIT_COMMAND_NOT_FOUND}
+ return ${EXIT_COMMAND_NOT_FOUND}
;;
${EXIT_ERROR_ASSERT})
log ERROR "Hook exited with an assertion error."
- exit ${EXIT_ERROR_ASSERT}
+ return ${EXIT_ERROR_ASSERT}
;;
esac