summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal-composer-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-25 18:22:49 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commitdb45a68715c07e6b8fe35e322ddcbbc6c473cb2b (patch)
tree43c1be13ddf78810ef8264b0816aad7d1565d92f /signal-composer-binding/signal-composer-binding.cpp
parentfb1d083aa2702b96ff33ab7f3249ef9b1ed5a715 (diff)
No errors on get if no values has been recorded
Change-Id: Ib1d5da084b3a39fbfc9816070aba008e3486cfae Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal-composer-binding.cpp')
-rw-r--r--signal-composer-binding/signal-composer-binding.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/signal-composer-binding/signal-composer-binding.cpp b/signal-composer-binding/signal-composer-binding.cpp
index cc3b9a8..1e14aad 100644
--- a/signal-composer-binding/signal-composer-binding.cpp
+++ b/signal-composer-binding/signal-composer-binding.cpp
@@ -186,12 +186,13 @@ void get(struct afb_req request)
return;
}
- ans = Composer::instance().getSignalValue(sig, options);
+ ans = Composer::instance().getsignalValue(sig, options);
- if (ans)
+ if (json_object_array_length(ans))
afb_req_success(request, ans, NULL);
else
- afb_req_fail(request, "error", NULL);
+ afb_req_fail(request, "error", "No signals found.");
+
}
int loadConf()