Add better error handling and sys.exit() messages