Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On Samsung Galaxy S4 there is an unexpected error that happens sometimes when users are using the Samsung default voice and tts.getVoices is called. This catches the error and notes the problem, falling back to the old approach to getting a list of locales since the voice list is not available.
Description
Added try block to catch the unexpected error. In that case of catching an error, the code falls back to the old method of getting a list of supported locales rather than just returning an empty list.
Added a local variable
retrieval_error
to mark the fact that there was a problem. Added a new execute optionerror_check
which returns true if there was an error retrieving the voices and false otherwise.Related Issue
Fixes #13
Difficult to test without a Galaxy S4. I had occasional reports of the error in my app until I added a try block to catch the offending code, then the errors went away until I re-installed my cordova plugins and forgot about the manual change I'd made.