Raise a RequestException for unexpected HTTP status codes.