Closed bpotard closed 1 year ago
Hello,
A rather confusing one; the error handling seems to be broken in (some) of the filters, leading to confusing messaging:
>>> xero.invoices.filter(IDs=["test"]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.9/site-packages/xero/basemanager.py", line 245, in wrapper raise XeroBadRequest(response) File "/usr/local/lib/python3.9/site-packages/xero/exceptions.py", line 53, in __init__ self.errors = [payload["oauth_problem"][0]] KeyError: 'oauth_problem'
The same call works fine with well-formed UUIDs:
>>> xeroc.xero.invoices.filter(IDs=["c681457b-8cac-4ba0-a67d-aaaaaaaaaaaa"]) []
A little bit of digging seems to indicate that xero returns this (in "html" format): Supplied parameter 'Ids' cannot be parsed - must be of type UUID.
Supplied parameter 'Ids' cannot be parsed - must be of type UUID.
So it seems here xero is ignoring the "Accept" header and returning a not very helpful output. But would it be possible to support this anyway?
Cheers!
Would it be possible? Sure. Patches are welcome.
Hello,
A rather confusing one; the error handling seems to be broken in (some) of the filters, leading to confusing messaging:
The same call works fine with well-formed UUIDs:
A little bit of digging seems to indicate that xero returns this (in "html" format):
Supplied parameter 'Ids' cannot be parsed - must be of type UUID.
So it seems here xero is ignoring the "Accept" header and returning a not very helpful output. But would it be possible to support this anyway?
Cheers!