Closed smvanbru closed 8 years ago
I assume you're referring to the difference between a FALSE
response from curl_exec
compared to a curl_exec
which returns with curl errors? In case you mean something like that I assume something like the following would help:
if ($response_data === false && !$ch->hasErrors()) {
throw new CurlException("Error: Curl request failed")
}
else if($ch->hasErrors()) {
throw new PinterestException('Error: execute() - cURL error: ' . $ch->getErrors(), $ch->getErrorNumber());
}
Let me know if the above is what you mean.
ya, that should do it. Thanks!
Cool, I've merged the changes into development. Shall be merged into master somewhere in the next few days.
Just released a new version which includes this fix.
At present, in Pinterest/Transport/Request.php, line 211-212, you raise an error for empty response with the same block of code as an error response. With that setup, the empty response is hard to identify in order to be handled appropriately in apps using this library. Would it be possible to adjust this bit to return an identifiable error code for empty responses? Thanks!