The error read-only property of the SpeechRecognitionErrorEvent interface returns the type of error raised.
error
MDN Reference