Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError on connection issues #106

Closed
jimbobhickville opened this issue Jun 9, 2016 · 1 comment
Closed

AttributeError on connection issues #106

jimbobhickville opened this issue Jun 9, 2016 · 1 comment

Comments

@jimbobhickville
Copy link
Contributor

It's expecting e.message to exist on any requests exception, but ConnectionError does not have that attribute:

    def _do_request(self, method, path, params=None, data=None):
        """Query Marathon server."""
        headers = {
            'Content-Type': 'application/json', 'Accept': 'application/json'}
        response = None
        servers = list(self.servers)
        while servers and response is None:
            server = servers.pop(0)
            url = ''.join([server.rstrip('/'), path])
            try:
                response = requests.request(
                    method, url, params=params, data=data, headers=headers,
                                            auth=self.auth, timeout=self.timeout)
                marathon.log.info('Got response from %s', server)
            except requests.exceptions.RequestException as e:
                marathon.log.error(
>                   'Error while calling %s: %s', url, e.message)
E               AttributeError: 'ConnectionError' object has no attribute 'message'
@jimbobhickville
Copy link
Contributor Author

Apparently this is a py3k issue. Exceptions no longer globally have a message attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant