mirror of
https://github.com/jambonz/freeswitch-modules.git
synced 2026-01-25 02:08:27 +00:00
Add Error Code Check to Google V1 Implementation (#51)
* Put the check for `grpc` error code 0 in the Google Speech-To-Text v1 as well. * Distinguish between two types of error object in `grpc_read_thread` * Improve naming of JSON field * Correct error in JSON field name. * Add sign-off to previous commit Signed-off-by: Andrew Golledge <andreas.golledge@gmail.com> --------- Signed-off-by: Andrew Golledge <andreas.golledge@gmail.com>
This commit is contained in:
1 parent
fea51d5ecf
commit
bd69d476e7
2 files changed
+4
-1
No files matched your search
@@ -349,6 +349,7 @@ static void *SWITCH_THREAD_FUNC grpc_read_thread(switch_thread_t *thread, void *
|
||||
else if (status.error_code() != 0) {
|
||||
cJSON* json = cJSON_CreateObject();
|
||||
cJSON_AddStringToObject(json, "type", "error");
|
||||
cJSON_AddStringToObject(json, "error_cause", "stream_close");
|
||||
cJSON_AddItemToObject(json, "error_code", cJSON_CreateNumber(status.error_code()));
|
||||
cJSON_AddStringToObject(json, "error_message", status.error_message().c_str());
|
||||
char* jsonString = cJSON_PrintUnformatted(json);
|
||||
|
||||
Reference in new issue
Block a user