Closed Taity180 closed 2 years ago
Hi @Taity180, thanks for raising this. It is on our SDK roadmap to improve the validation exception experience.
Just clarifying, you are expecting an .NET exception but it should also return an ValidationException object.
Hi jenksguo, thank you for your response, I was expecting a .NET ValidationException which is how the Xero API 1.0 would handle an error issue. The Exception that is returning now has within the InnerException which I have pushed to a Json String and have managed to extract the ValidationErrors which is where the Xero is adding any errors into and going from there.
Thanks.
Issue is resolved in latest version of SDK:
Hi, I am migrating my existing Xero api code from OAuth 1.0 to OAuth 2.0.
Currently using
The issue that I am having is when I am using the CreateInvoiceAsync call thought the AccountingApi and I get an exception, previosuly in 2.0 I would be getting a ValidationException, but now i am only getting an Exception. The Exception type coming in is a type ValidationException, but I can't access the error messages as needed.
To Reproduce, what i have done is create a new api call using AccountingApi and CreateInvoiceAsync and i added in an Item code which doesn't exist in my Xero account. the exception will return with the error bundled inside. What i was excepting to happen was i would be able to catch a ValidationException?
Thanks