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

AlreadyExpiredException is thrown incorrectly when the query includes the error name. #875

Closed
oogFranz opened this issue Apr 20, 2019 · 1 comment · Fixed by #954
Closed

Comments

@oogFranz
Copy link
Contributor

oogFranz commented Apr 20, 2019

Summary of problem or feature request

When 400 error occurred, the client may throw AlreadyExpiredException event if the error is NOT AlreadyExpiredException surely.

Code snippet of problem

This is an example.

$param = [
    'index' => 'test',
    'body' => [
        "query" =>
            [
                'query_string' => [
                    'fields' => ['field1'],
                    'query' => 'AlreadyExpiredException NOT'
                ]
            ]
    ]
];
$result = $client->search($param);

Because the query includes "AlreadyExpiredException", the error is regarded as AlreadyExpiredException. It should be parse_exception.

This code has the problem.
https://github.com/elastic/elasticsearch-php/blob/v6.1.0/src/Elasticsearch/Connections/Connection.php#L602

ScriptLangNotSupportedException also has same issue.

System details

  • Operating System
    Linux
  • PHP Version
    7.3.4
  • ES-PHP client version
    6.1.0
  • Elasticsearch version
    7.0.0
@oogFranz
Copy link
Contributor Author

oogFranz commented Apr 20, 2019

Further more, the AlreadyExpiredException seems be removed since Elasticsearch 6.0.0.
elastic/elasticsearch#24857

It is better to remove the if statement from elasticsearch-php also.

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