diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-08-05 16:27:17 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-08-12 12:23:11 +0200 |
commit | 87930e8eca1012977acdde31fbae37a7998fd083 (patch) | |
tree | faa14cd1252a47161e80b0a00aeb5e274d9563a6 | |
parent | 59da9b4952b9c8852658aa27eb23992769d6b05c (diff) |
Remove error when no stream was created by mixer
Remove error generation when no stream was created by mixer
at 'attach' call.
BUG-AGL: SPEC-2733
Change-Id: If5f0b521c449d3599925abe5e3e5a22d849f3c5d
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
-rw-r--r-- | src/4a-internals-hal/4a-internals-hal-mixer-link.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/4a-internals-hal/4a-internals-hal-mixer-link.c b/src/4a-internals-hal/4a-internals-hal-mixer-link.c index 96e5552..8b15afc 100644 --- a/src/4a-internals-hal/4a-internals-hal-mixer-link.c +++ b/src/4a-internals-hal/4a-internals-hal-mixer-link.c @@ -117,7 +117,9 @@ int InternalHalHandleMixerAttachResponse(afb_api_t apiHandle, struct InternalHal if(wrap_json_unpack(mixerResponseJ, "{s?:o}", "streams", &mixerStreamsJ)) { - AFB_API_ERROR(apiHandle, "Can't get streams object in '%s'", json_object_get_string(mixerResponseJ)); + AFB_API_ERROR(apiHandle, + "An error happened when tried to decode mixer response ('%s')", + json_object_get_string(mixerResponseJ)); return -2; } @@ -132,6 +134,10 @@ int InternalHalHandleMixerAttachResponse(afb_api_t apiHandle, struct InternalHal return -3; } } + else { + AFB_API_WARNING(apiHandle, "No stream was created by mixer ('%s')", json_object_get_string(mixerResponseJ)); + return 1; + } return 0; } @@ -211,22 +217,29 @@ int InternalHalAttachToMixer(afb_api_t apiHandle) err = -7; } else if(! responseJ) { - AFB_API_ERROR(apiHandle, - "Seems that %s call to api %s succeed but no response was returned", - MIXER_ATTACH_VERB, - apiToCall); - err = -8; + AFB_API_WARNING(apiHandle, + "Seems that %s call to api %s succeed but no response was returned", + MIXER_ATTACH_VERB, + apiToCall); } else { mixerError = InternalHalHandleMixerAttachResponse(apiHandle, currentHalData->internalHalData, responseJ); - if(mixerError) { + if(mixerError < 0) { AFB_API_ERROR(apiHandle, - "Seems that %s call to api %s succeed but this warning was risen by response decoder : %i '%s'", + "Seems that %s call to api %s succeed but this error was send by response decoder : %i '%s'", MIXER_ATTACH_VERB, apiToCall, mixerError, json_object_get_string(responseJ)); - err = -9; + err = -8; + } + else if(mixerError > 0) { + AFB_API_WARNING(apiHandle, + "Seems that %s call to api %s succeed but warning %i was rised by response decoder : '%s'", + MIXER_ATTACH_VERB, + apiToCall, + mixerError, + json_object_get_string(responseJ)); } else { AFB_API_NOTICE(apiHandle, |