Skip to content

Handle recursive error details #2152

@russcam

Description

@russcam

An error in Elasticsearch can have multiple recursive details for the cause of the error e.g.

{
        "update": {
            "_index": "testindex",
            "_type": "docmodel",
            "_id": "xyz",
            "status": 400,
            "error": {
                "type": "illegal_argument_exception",
                "reason": "failed to execute script",
                "caused_by": {
                    "type": "script_exception",
                    "reason": "failed to run inline script [use(java.lang.Exception) {throw new Exception(\"Custermized Exception\")}] using lang [groovy]",
                    "caused_by": {
                        "type": "privileged_action_exception",
                        "reason": null,
                        "caused_by": {
                            "type": "exception",
                            "reason": "Custom Exception"
                        }
                    }
                }
            }
        }
}

Currently, the client parses only the top level type, reason and caused_by, but should handle nested caused_by objects

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