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

Delete character number restriction on error messages #270

Open
zLukas opened this issue Feb 8, 2022 · 2 comments
Open

Delete character number restriction on error messages #270

zLukas opened this issue Feb 8, 2022 · 2 comments
Labels

Comments

@zLukas
Copy link

zLukas commented Feb 8, 2022

In current version of python-lib maas dowlnoaded from github (commit ae3e321)
Error messages can be no longer than 50 characters:

# amc/lib/python3.8/site-packages/maas/client/bones/__init__.py
class CallError(Exception):
    def __init__(self, request, response, content, call):
        desc_for_request = "%(method)s %(uri)s" % request
        desc_for_response = "HTTP %s %s" % (response.status, response.reason)
        desc_for_content = content.decode("utf-8", "replace")
        desc = "%s -> %s (%s)" % (
            desc_for_request,
            desc_for_response,
            desc_for_content
            if len(desc_for_content) <= 50
            else (desc_for_content)[:49] + "…"),
        )
        super(CallError, self).__init__(desc)
        self.request = request
        self.response = response
        self.content = content
        self.call = call

This lead to the situation where Error message actually tells nothing about error:

maas.client.bones.CallError: POST <http> -> HTTP 409 Conflict (Cannot set default gateway interface because the …)

I don't see a point of restricting such messages.

@samschmitt22
Copy link

I am also routinely annoyed by this.

Copy link

github-actions bot commented Feb 2, 2024

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants