Skip to content

Improve IndexNotFoundException message - specify the index name #34628

Closed
@atapin

Description

@atapin

Currently I see the following stacktrace in logs: Caused by: org.elasticsearch.index.IndexNotFoundException: no such index. This makes finding a root cause hard in case of multiple indices. I suggest to populate the default error message with a missing index name:

class IndexNotFoundException ... {
    public IndexNotFoundException(String index, Throwable cause) {
        super("no such index: " + index , cause);
        setIndex(index);
    }

    public IndexNotFoundException(Index index, Throwable cause) {
        super("no such index: " + index.toString(), cause);
        setIndex(index);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions