Change exception to IOError to allow connection retry