proper exception when unable to connect and invalid status codes