Closed ChimeraCoder closed 4 years ago
Yeah, that's definitely a thing we can do. I'll get on it! (Likely not today, but maybe tomorrow!)
Ok, back on this now. The pattern in other places has been to verify that the response has the status code that the docs expect. These search methods lack any of this checking, whereas the various DELETE/POST/PUT methods do. I'll first adjust this behavior and see how that looks.
At the moment, the high-level query functions exposed (such as
SearchCharts
) don't expose the status code of the underlying HTTP request. Looking atdoRequest
/doRequestWithToken
, it looks like the method will return a non-nil error if there is a network error, but not for 4xx/5xx statuses, which will not get passed on to the higher-level methods.Could we either expose the HTTP status information in the result struct types (such as
SearchResult
), or perform an HTTP status check withindoRequestWithToken
itself to represent the non-200 status codes as non-nil error values?