Descriptive ApiError for purchase preview enpoint
muratovi opened this issue · 6 comments
Not sure whether it's relevant after #55 was resolved, but if billing information has state (not configured in avalara) and zip code for state that is configured in avalara following error is thrown by API:
I'd actually expect that to be a ValidationException
and not a generic ApiError
. What are the details in the error
property?
I'd actually expect that to be a
ValidationException
and not a genericApiError
. What are the details in theerror
property?
It returns "Tax service currently not available, please try again later."
But in reality service is available, but provided billing information is intentionally incorrect (NY as state and NJ as zip code)
Okay, thanks for providing the details. Let me see what is happening on the API side. I'd expect the server to be doing something different.
@muratovi It appears that the API is not properly distinguishing b/w different error categories from our tax service. I'm going to file a ticket to investigate this and perhaps get a fix out. We should only be throwing that "service_not_available" error in the event that the service is actually down.
@bhelx Can you include Error
object into exception message and review logic on how message
and params
fields are populated ?
public ApiException(String message, Error e) {
super(message);
this.error = e;
}
In some exceptions only message
or params
field is populated, that complicates usage of API:
I believe this has been addressed. Feel free to re-open or continue the discussion if not.