Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strpos on null, need better graceful handling in the event the $responseBody is null #1182

Open
mohammed-adil-moughal opened this issue Dec 7, 2021 · 3 comments

Comments

@mohammed-adil-moughal
Copy link

if ($statusCode === 500 && strpos($responseBody, "RoutingMissingException") !== false) {

@mohammed-adil-moughal mohammed-adil-moughal changed the title Strpos on null, need better gracefull handling in the event the responseBody is null Strpos on null, need better graceful handling in the event the $responseBody is null Dec 7, 2021
@technige
Copy link

@mohammed-adil-moughal Have you seen a null $responseBody in the wild, or is this a hypothetical problem? If so, could you provide details of the code which generates such a failure, so that we can test and reproduce? Thanks.

@mohammed-adil-moughal
Copy link
Author

Hey @technige yeah i encountered it sometime when had some failures on aws hope this helps



[{file: /var/www/project/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php, function: strpos, line: 658}, {class: Elasticsearch\Connections\Connection, file: /var/www/project/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php, function: process5xxError, line: 320, type: ->}, {class: Elasticsearch\Connections\Connection, file: /var/www/project/vendor/react/promise/src/FulfilledPromise.php, function: Elasticsearch\Connections\{closure}, line: 28, type: ->},
--



@technige
Copy link

Thanks @mohammed-adil-moughal - this helps us prioritise :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants