FLUID-6533: Orator component throws unhandled promise rejection when synthesis fails

Metadata

Source
FLUID-6533
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Colin Clark
Reporter
Justin Obara
Created
2020-07-23T09:31:40.068-0400
Updated
2024-07-22T10:35:12.398-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Self Voicing

Description

In the FLUID-6145 line promise rejections need to be handled. The orator component fails to handle rejections of promises stemming from the speech synthesis throwing an error.

The root promise is in the fluid.textToSpeech.utterance grade which resolves/rejects the promise based on the speech utterance's onend and onerror events.

The above promise is followed by the one generated in fluid.textToSpeech.queueSpeech promise.

Eventually these all follow up to the being handled in the fluid.orator.domReader.readFromDOM and fluid.orator.selectionReader.queueSpeech functions. However, they both only handle promise resolutions and not rejections. These should both provide an appropriate handler for when the promise rejects.

NOTE: This was first discovered when testing MS Edge 44 with the Story Telling tool. It seems that Edge 44 throws an error if the speech synthesis utterance has the lang attribute set to a language code for which there is no matching synthesizer available.