Skip to content

[Confluence] credential fail leads to confusing error #332

Closed
@cybit

Description

@cybit

When giving wrong credentials to a Confluence instance I get an AttributeError later on. Which tells me nothing about the reason why it failed.

Example:

confluence = Confluence(
                url=url,
                username=username,
                password=wrong_password,
            )
page_id = confluence.get_page_id(space, page_title)

And I get a TraceBack that ends like this:

page_id = confluence.get_page_id(space, page_title)
   File "lib/python3.7/site-packages/atlassian/confluence.py", line 85, in get_page_id
     return (self.get_page_by_title(space, title) or {}).get('id')
   File "/lib/python3.7/site-packages/atlassian/confluence.py", line 128, in get_page_by_title
     return (self.get(url, params=params) or {}).get('results')[0]
 AttributeError: 'str' object has no attribute 'get'

I would have preferred to get an AuthenticationError or something like that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions