-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Improved IndexNotFoundException's default error message #34649
Improved IndexNotFoundException's default error message #34649
Conversation
Pinging @elastic/es-core-infra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left one comment
@@ -37,7 +40,7 @@ public IndexNotFoundException(String index) { | |||
} | |||
|
|||
public IndexNotFoundException(String index, Throwable cause) { | |||
super("no such index", cause); | |||
super(makeMessage(index), cause); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be ok to duplicate the message like this:
super(makeMessage(index), cause); | |
super("no such index ["+ index + "]", cause); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also have a convention to embed things like index names in [ ]
@elasticmachine ok to test |
190e09d
to
332fdd8
Compare
Blocked by #34731 |
server/src/main/java/org/elasticsearch/index/IndexNotFoundException.java
Show resolved
Hide resolved
@@ -46,7 +46,7 @@ public IndexNotFoundException(Index index) { | |||
} | |||
|
|||
public IndexNotFoundException(Index index, Throwable cause) { | |||
super("no such index", cause); | |||
super("no such index " + index.toString(), cause); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "no such index [" + index.getName() + "]"
as index.toString()
could return smth like [index42/n6gzFZTgS664GUfx0Xrpjw]
that is a bit inconsistent with other messages
332fdd8
to
58ab72c
Compare
by including the missing index name. Fixes elastic#34628.
58ab72c
to
3ab8f53
Compare
@atapin great job. there are as well yaml-based tests, failed test points to |
@vladimirdolzhenko oops I missed that guy. thanks for the hint. |
Thanks for the contribution @atapin! |
This commit adds the index name to the error message when an index is not found.
This commit adds the index name to the error message when an index is not found.
Note that this was not actually included in 6.5.0 (I have now removed the label). The backport had failures which were difficult to track down, and at this point I do not see a compelling reason to investigate given prereleases of 7.0 are being built. |
The message is improved by including the missing index name. Fixes #34628.