summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-11 17:27:43 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-11 18:00:12 +0200
commit37c529288071ea68f70932d278433f9d11fb22be (patch)
treec3ab9f59ccb716047145ac431418ec6b9bdaa308
parent62beb2106316b8e72403d393499e18f7b1d191b8 (diff)
Correct issues when calling info verb
Correct issues when calling info verb : - Two 'AFB_ReqFail' was called when an error was detected on info call reqsuest json (generating an application framework error). - The error messages wasn't up to date. Change-Id: Ifbb94854bc8a9d13ddf702defa94eaa6cf87e9ba Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
-rw-r--r--plugins/alsa/alsa-api-mixer.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/alsa/alsa-api-mixer.c b/plugins/alsa/alsa-api-mixer.c
index 21acc1c..30f47a2 100644
--- a/plugins/alsa/alsa-api-mixer.c
+++ b/plugins/alsa/alsa-api-mixer.c
@@ -484,8 +484,8 @@ STATIC void MixerInfoAction(AFB_ReqT request, json_object * argsJ) {
, "zones", &zonesJ
);
if (error) {
- AFB_ReqFailF(request, "invalid-syntax", "list missing 'quiet|stream|backend|source' argsJ=%s", json_object_get_string(argsJ));
- goto OnErrorExit;
+ AFB_ReqFailF(request, "invalid-syntax", "list missing 'verbose|streams|ramps|captures|playbacks|zones' argsJ=%s", json_object_get_string(argsJ));
+ return;
}
json_object *responseJ = json_object_new_object();
@@ -493,8 +493,8 @@ STATIC void MixerInfoAction(AFB_ReqT request, json_object * argsJ) {
if (streamsJ) {
json_object *resultJ = MixerInfoStreams(mixer, streamsJ, verbose);
if (!resultJ) {
- AFB_ReqFailF(request, "invalid-object", "streams should be boolean or string argsJ=%s", json_object_get_string(streamsJ));
- goto OnErrorExit;
+ AFB_ReqFailF(request, "not-found", "fail to find streams (should be a boolean, a string, or an array of them) argsJ=%s", json_object_get_string(streamsJ));
+ return;
}
json_object_object_add(responseJ, "streams", resultJ);
}
@@ -522,9 +522,6 @@ STATIC void MixerInfoAction(AFB_ReqT request, json_object * argsJ) {
AFB_ReqSuccess(request, responseJ, NULL);
return;
-
-OnErrorExit:
- AFB_ReqFail(request, "internal-error", "fail to get mixer info");
}
STATIC void MixerInfoVerb(AFB_ReqT request) {