Bug 1323207: raise proper exception when a port is not found