The SpeechRecognitionErrorEvent interface of the Web Speech API represents error messages from the recognition service.
SpeechRecognitionErrorEvent()Creates a new SpeechRecognitionErrorEvent object.
SpeechRecognitionErrorEvent also inherits properties from its parent interface, Event.
SpeechRecognitionErrorEvent.error Read onlyReturns the type of error raised.
SpeechRecognitionErrorEvent.message Read onlyReturns a message describing the error in more detail.
const recognition = new SpeechRecognition();
recognition.onerror = (event) => {
console.log(`Speech recognition error detected: ${event.error}`);
console.log(`Additional information: ${event.message}`);
};