I have use try exception block it will manage exception but not convert from voice to text.
import speech_recognition as sr # recognise speech import