recurly-client-php
recurly-client-php copied to clipboard
improvement: check response always, not only through makeRequest
When performing makeRequest, request were undergoing proper validation, and could throw errors. In pagerCount, though, _getResponse was not followed by toResource, so it was not validated, even if the HEAD response had an erroneous status code.
This patch makes bad HEAD responses (like: invalid API key) throw errors just like any other response.
Requires my previous PR (validation of headers even in json-without-body case) to work properly.