Replaced `except Exception` with more specific one.