aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-config.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-05 22:41:28 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-05 22:41:28 +0200
commitce075383309a30bb7084309014c7f1c2f699bf01 (patch)
treef1319519c85fc5078edce7e950a1c1b49675d23f /ctl-lib/ctl-config.c
parent625ce776e0e9ed869da90659eb988ee32de4cf3b (diff)
Abort if one required API is missing
AFB returns a missing API as a warning and doesn't abort the process. It is a binding duty to know if it should exit or not. Here a missing API is considerate as an error and abort the binder. Change-Id: Id11bcc34fd5fa8fd8a9a5cbd70d6d3340190dc1d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.c')
-rw-r--r--ctl-lib/ctl-config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index f583158..e7bdc14 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -108,7 +108,8 @@ static int DispatchRequireOneApi(AFB_ApiT apiHandle, json_object * bindindJ) {
const char* requireBinding = json_object_get_string(bindindJ);
int err = AFB_RequireApi(apiHandle, requireBinding, 1);
if (err) {
- AFB_ApiWarning(apiHandle, "CTL-LOAD-CONFIG:REQUIRE Fail to get=%s", requireBinding);
+ AFB_ApiError(apiHandle, "CTL-LOAD-CONFIG:REQUIRE Fail to get=%s. Aborting.", requireBinding);
+ exit(1);
}
return err;