grimoirelab-perceval icon indicating copy to clipboard operation
grimoirelab-perceval copied to clipboard

[Client] Improve HTTP error log

Open animeshk08 opened this issue 4 years ago • 1 comments

Current if an HTTP error is thrown by an API the log print error.response.reason as a result of

https://github.com/chaoss/grimoirelab-perceval/blob/7f4cceb1c2cf032309193854cf8e6b653a0cfd0c/perceval/client.py#L181

However, many times the actual reason for the error is returned in ``error.response.text`. A log message can be printed in case an exception is thrown. This will help users to easily debug the error and also possibly avoid the need of such checks:

https://github.com/chaoss/grimoirelab-perceval/blob/7f4cceb1c2cf032309193854cf8e6b653a0cfd0c/perceval/backends/core/groupsio.py#L214

https://github.com/chaoss/grimoirelab-perceval/blob/7f4cceb1c2cf032309193854cf8e6b653a0cfd0c/perceval/backends/core/pagure.py#L314

animeshk08 avatar May 26 '20 22:05 animeshk08

Thank you @animeshk08 for opening this issue and providing the fix.

valeriocos avatar May 27 '20 15:05 valeriocos