try: #whatever it is you're doing except ValueError: #do some error recovery