Skip to content

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

@oogFranz

Description

@oogFranz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions