Can we use a more specific exception here? At least `Exception` - using bare `except:` is rarely a good idea because it catches KeyboardInterrupt and SystemExit.