Question

Is there a way to get more specific information about the exception/error that occurred when interacting with QuickBooks Online?

I've been messing around and testing certain things and I would get an exception but all it would say is "BadRequest" from a IdsException, which isn't too helpful. So I was just curious if there was a way to extract more information. I know they put more information and such in the response body but since I'm using a DataService object I'm not sure how to see the response body.

I've checked Intuits documentation and checked all the properties and methods I could think to check but haven't had any luck so far.

If I need to put up an example of what I'm doing I can. Thanks for any help.

Was it helpful?

Solution

When sending information to QuickBooks Online and QuickBooks does not like what you are sending you will get a ValidationException.

This exception is clearly not too helpful as it is very vague. However, if you catch it and then look for the InnerExceptions array of IdsError you can find more information about what actually went wrong.

In my situation I would catch the main exception, ex, and have to do this:

ex.InnerException.InnerExceptions(i).Message

From there you can either display it or concat all the errors together or anything else you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top