summaryrefslogtreecommitdiffstats
path: root/ctl-lib
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-13 15:02:55 +0100
commitd488fe186c5e51ae99c93ed78ffd87c57ac231c6 (patch)
treef1319519c85fc5078edce7e950a1c1b49675d23f /ctl-lib
parent037a877a8369aa75ed0c59e5729db7577db2b8d0 (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')
-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;