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

Issues in exceptions.py #62

Open
padthaitofuhot opened this issue Apr 16, 2019 · 1 comment
Open

Issues in exceptions.py #62

padthaitofuhot opened this issue Apr 16, 2019 · 1 comment
Assignees

Comments

@padthaitofuhot
Copy link
Contributor

Fedor: who is supporting python client? Code in client:

        a = self.message
        if self.ecs_details not in a:
            a += ' - %s' % self.ecs_details
        if self.ecs_description not in a:
            a += ' - %s' % self.ecs_description
        b = ''
        if self.http_scheme:
            b += '%s://' % self.http_scheme
        if self.http_host:
            b += self.http_host
        if self.http_port:
            b += ':%s' % self.http_port
        if self.http_path:
            b += self.http_path
        if self.http_query:
            b += '?%s' % self.http_query
        if self.http_status:
            if b:
                b = '%s %s' % (b, self.http_status)
            else:
                b = str(self.http_status)
        if self.http_reason:
            if b:
                b = '%s %s' % (b, self.http_reason)
            else:
                b = '- %s' % self.http_reason
        if self.http_response_content:
            if len(self.http_response_content) <= 60:
                b += '   %s' % self.http_response_content
            else:
                b += '  [first 60 chars of response] %s' \
                     % self.http_response_content[:60]
        return b and '%s: %s' % (a, b) or a```
Fedor: https://github.com/EMCECS/python-ecsclient/blob/master/ecsclient/common/exceptions.py#L72
Fedor: It's creating new exceptions)
Fedor: every exception raising use it
Fedor: and `first 60 chars of response` is too small. I think we should increase size of message. It's just logs, so I don't understand why client needs to cut messages
@fedor-chemashkin
Copy link

If some kind of non-standard exception has occurred, then you have to look here. But here the code is also not very clear. Also 60 character is very small message and cut all useful information

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

No branches or pull requests

3 participants