XeroAPI / Xero-NetStandard

A wrapper of the Xero API in the .NetStandard 2.0 framework. Supports Accounting, Payroll AU/US, and Files
MIT License
127 stars 124 forks source link

ErrorText on successful response #565

Open tqrecords opened 1 month ago

tqrecords commented 1 month ago

Version: 9.2.0

I have this line in my code for every response received from an api endpoint:

if (result.ErrorText != null) throw new Exception(result.ErrorText);

I'm checking for exceptions too, but I think I added this in as a fallback. In the latest update, it looks like the ErrorText field returns 'OK' on all successful responses. Is this a bug?

Since all my methods contain this fallback, I think I can apply this fix:

if (result.StatusCode != HttpStatusCode.OK) throw new Exception(result.ErrorText);

Wanted to flag because it's weird that the error text fields is populated when there are no errors.

github-actions[bot] commented 1 month ago

PETOSS-643

github-actions[bot] commented 1 month ago

Thanks for raising an issue, a ticket has been created to track your request