XeroAPI / Xero-NetStandard

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

Issue with item requested not found when calling endpoing #490

Closed AGenius closed 5 months ago

AGenius commented 8 months ago

SDK you're using (please complete the following information):

Describe the bug A clear and concise description of what the bug is. When updating my API Wrapper I was testing a call to get a random bank transfer. I was calling the wrong path (BankTransaction instead of BankTransfer) but passing a bank transfer guid. When this was called I was getting an ApiException from the ApiClient code throw new ApiException(500, e.Message); of "Unexpected character encountered while parsing value: T. Path '', line 0, position 0." I would expect a clean "item not found" response from your ApiClient call when it received "The resource you're looking for cannot be found" but it does not It should detect a StatusCode = "NotFound" and continue .

To Reproduce Steps to reproduce the behavior: Call the BankTransaction endpoint with a Guid that does not exist. I have tested not found items with other endpoints and they are the same issue

Expected behaviour A clear and concise description of what you expected to happen. Return the correct error response as "Not Found"

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context Add any other context about the problem here. Not sure if this has always been this way

github-actions[bot] commented 8 months ago

PETOSS-362

github-actions[bot] commented 8 months ago

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

thomas-anu commented 5 months ago

Updated Xero-NetStandard SDK v3.34.5 with changes to throw specific exceptions with the status code and actual message instead of 500. Please verify.