From fcaf8fe8eed1370efa4dd02310d2607f3a59f03f Mon Sep 17 00:00:00 2001 From: Arjanvanmaren Date: Mon, 8 Mar 2021 04:55:35 +0100 Subject: [PATCH] feat(Android): Expose error code (#302) --- android/src/main/java/com/wenkesj/voice/VoiceModule.java | 1 + 1 file changed, 1 insertion(+) diff --git a/android/src/main/java/com/wenkesj/voice/VoiceModule.java b/android/src/main/java/com/wenkesj/voice/VoiceModule.java index d2d701d7..f22833ee 100644 --- a/android/src/main/java/com/wenkesj/voice/VoiceModule.java +++ b/android/src/main/java/com/wenkesj/voice/VoiceModule.java @@ -307,6 +307,7 @@ public void onError(int errorCode) { String errorMessage = String.format("%d/%s", errorCode, getErrorText(errorCode)); WritableMap error = Arguments.createMap(); error.putString("message", errorMessage); + error.putString("code", String.valueOf(errorCode)); WritableMap event = Arguments.createMap(); event.putMap("error", error); sendEvent("onSpeechError", event);