Conversation
|
hey @krichprollsch thans for the PR! It's not immediately clear to me what the issue was in the old codebase and how this addresses it - could you describe the goal in more detail? |
|
The problems was in the way the $this->handleError($ch, $httpResponse);
To address the second point, I need to get the response code and the body of the request. The method |
lib/Segment/Consumer/LibCurl.php
Outdated
| } | ||
|
|
||
| $httpResponse = curl_getinfo($ch, CURLINFO_HTTP_CODE); | ||
| if ($httpResponse != 200) { |
|
Hi ! 👍 for this PR, the wrong order of parameters causes many mistakes to me 😞 About the choosen label: it is not an improvment, it is a real bug (no error message + wrong order of parameters on |
|
you're welcome @smourph, happy to help you. |
Codecov Report
@@ Coverage Diff @@
## master #97 +/- ##
===========================================
- Coverage 86.05% 85.4% -0.66%
Complexity 121 121
===========================================
Files 8 8
Lines 373 370 -3
===========================================
- Hits 321 316 -5
- Misses 52 54 +2
Continue to review full report at Codecov.
|
|
Hello, I have updated my PR to solve the conflicts. Please @f2prateek can you merge one of these PR soon? |
The method
Consumer::handleErrorwaits an error code and a string (see https://github.com/segmentio/analytics-php/blob/master/lib/Segment/Consumer.php#L93)This PR fix the bad parameters call and return a real string content as error instead of the curl resource.
Moreover I removed the
Consumer::executePostwhich was public (so it's a BC break) to use a loop for retry.I also introduced a
curl_errorcheck to handle specific curl errors.