summaryrefslogtreecommitdiffstats
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-12-12 17:44:41 +0100
commita492cbfe993139fe50950bb42f8a3dfcce094146 (patch)
treeb1e73dc497da8b094df083b3061f266ccd347164 /ctl-lib/ctl-config.c
parent8e49f8deefafd2dda3f540542bbee74b35251a47 (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;