atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

Improve logging error message for get() in rest_client.py

Open solarjoe opened this issue 4 years ago • 1 comments

Please add some additional text to the this error message used during reponse handling.

https://github.com/atlassian-api/atlassian-python-api/blob/c9b4bb0156983fdff1b9b87bc5376784cb400766/atlassian/rest_client.py#L284

The log shows something like ERROR:atlassian.rest_client:Expecting value: line 1 column 1 (char 0) which looks rather serious while it isn't.

Instead you could use something like

logging.error('JSON not found, returning text instead')

solarjoe avatar May 18 '21 11:05 solarjoe

Its a general exception caught which could be the reason why a general error is placed.

Depending on what lead you to that error we can segregate the error message better.

You could share your example that gave you this error.

Also your code PR if you know what could be a good solution, thanks.

isaac-philip avatar Jul 14 '21 17:07 isaac-philip