atlassian-python-api
atlassian-python-api copied to clipboard
[Confluence] Add verbose error message in case wrong HTML
As a Confluence API wrapper user, I want to see more verbose error message in case wrong HTML content is used to build a page. For example when the wrong HTML content is used to build a page, the following error message is raised:
File "/Users/v/.pyenv/versions/automation/lib/python3.7/site-packages/atlassian/confluence.py", line 638, in create_page
response = self.post(url, data=data)
File "/Users/v/.pyenv/versions/automation/lib/python3.7/site-packages/atlassian/rest_client.py", line 312, in post
absolute=absolute,
File "/Users/v/.pyenv/versions/automation/lib/python3.7/site-packages/atlassian/rest_client.py", line 236, in request
response.raise_for_status()
File "/Users/v/.pyenv/versions/automation/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: for url: https://confluence.com/rest/api/content
Unfortunately, it doesn't show what HTML part is wrong and why it was failed, just says that we got 400 error response from the Confluence server.
It would be great to extend the error message with the real reason, what HTML part is wrong to make it easier for debugging. Currently, it's tough to debug such issues when we have huge HTML content.