freakboy3742 / pyxero

Python API for accessing the REST API of the Xero accounting tool.
BSD 3-Clause "New" or "Revised" License
281 stars 208 forks source link

When XeroRateLimitExceeded is thrown the limit that was exceeded is not included in output #323

Open Ian2020 opened 2 years ago

Ian2020 commented 2 years ago

It would be good to see the exact limit that was exceeded when we get a rate limit exception in the exception's msg. As the code stands this is the output of an XeroRateLimitExceeded exception:

...
  File "/home/user/.local/lib/python3.9/site-packages/xero/basemanager.py", line 264, in wrapper
    raise XeroRateLimitExceeded(response, payload)
xero.exceptions.XeroRateLimitExceeded: please wait before retrying the xero api

The limit information is available in the exception, it's just not included in the error string.