From d488fe186c5e51ae99c93ed78ffd87c57ac231c6 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 5 Oct 2018 22:41:28 +0200 Subject: 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 --- ctl-lib/ctl-config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit 1.2.3-korg