Skip to content

Commit c5db567

Browse files
committed
[TEST] make PHP 5.x happy
1 parent e7d7392 commit c5db567

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Elasticsearch/Transport.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ function ($response) {
113113
// Note, this could be a 4xx or 5xx error
114114
},
115115
//onFailure
116-
function ($response) {
116+
function (\Exception $response) {
117117
// Ignore 400 level errors, as that means the server responded just fine
118-
if (!(isset($response['code']) && $response['code'] >=400 && $response['code'] < 500)) {
118+
$code = $response->getCode();
119+
if (!(isset($code) && $code >=400 && $code < 500)) {
119120
// Otherwise schedule a check
120121
$this->connectionPool->scheduleCheck();
121122
}

0 commit comments

Comments
 (0)