files/en-us/web/api/speechrecognitionerrorevent/error/index.md
{{APIRef("Web Speech API")}}
The error read-only property of the
{{domxref("SpeechRecognitionErrorEvent")}} interface returns the type of error raised.
An enumerated value representing the type of error. Possible values include:
aborted
audio-capture
bad-grammar {{deprecated_inline}} {{non-standard_inline}}
[!NOTE] This error is no longer part of the Web Speech API specification; the concept of grammar has been removed from the Web Speech API. Related features remain in the specification and are still recognized by supporting browsers for backwards compatibility, but they have no effect on speech recognition services.
language-not-supported
lang attribute of the {{domxref("SpeechRecognition")}} object. The set of supported languages is browser-dependent, and there is no way to programmatically determine from front-end code the languages a user's browser supports for speech recognition.network
no-speech
not-allowed
phrases-not-supported
service-not-allowed
const recognition = new SpeechRecognition();
recognition.onerror = (event) => {
console.log(`Speech recognition error detected: ${event.error}`);
console.log(`Additional information: ${event.message}`);
};
{{Specifications}}
{{Compat}}