aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-onload.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctl-lib/ctl-onload.c')
-rw-r--r--ctl-lib/ctl-onload.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ctl-lib/ctl-onload.c b/ctl-lib/ctl-onload.c
index f319103..9baa689 100644
--- a/ctl-lib/ctl-onload.c
+++ b/ctl-lib/ctl-onload.c
@@ -24,6 +24,7 @@
// onload section receive one action or an array of actions
int OnloadConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *actionsJ) {
+ int err = 0;
// Load time parse actions in control file
if (actionsJ != NULL) {
@@ -47,9 +48,14 @@ int OnloadConfig(AFB_ApiT apiHandle, CtlSectionT *section, json_object *actionsJ
source.api = section->actions[idx].api;
source.request = AFB_ReqNone;
- ActionExecOne(&source, &section->actions[idx], NULL);
+ if(!err)
+ err = ActionExecOne(&source, &section->actions[idx], NULL);
+ else {
+ AFB_ApiError(apiHandle, "Onload action execution failed on: %s", source.uid);
+ return err;
+ }
}
}
- return 0;
+ return err;
}