Skip to content

Conversation

@javanna
Copy link
Member

@javanna javanna commented Jul 14, 2017

With #23997 and #25268 we have changed put alias, delete alias, update aliases and delete index to not accept aliases. Instead concrete indices should be provided as their index parameter.

This PR improves the error message in case aliases are provided, from an IndexNotFoundException (404 status code) with "no such index" message, to an IllegalArgumentException (400 status code) with "The provided expression [alias] matches an alias, specify the corresponding concrete indices instead." message.

Note that there is no specific error message for the case where wildcard expressions match one or more aliases. In fact, aliases are simply ignored when expanding wildcards for such APIs. An error is thrown only when the expression ends up matching no indices at all and allow_no_indices is set to false. In that case the error remains the generic "404 - no such index". I find it confusing to throw a different error in case it's only the matching aliases (getting ignored) that cause the error.

@javanna javanna added :Data Management/Indices APIs APIs to create and manage indices and templates >non-issue review v6.0.0 labels Jul 14, 2017
@javanna javanna requested a review from martijnvg July 14, 2017 14:55
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea too...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to remove this logic but tests start to fail, I will dig deeper another time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be more in sync with the majority of ES msgs if indices is replaced with index in specify the corresponding concrete indices instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it can be more than one index as an alias can point to multiple indices. Would you change that anyway?

With elastic#23997 and elastic#25268 we have changed put alias, delete alias, update aliases and delete index to not accept aliases. Instead concrete indices should be provided as their index parameter.

This commit improves the error message in case aliases are provided, from an IndexNotFoundException (404 status code) with "no such index" message, to an IllegalArgumentException (400 status code) with "The provided expression [alias] matches an alias, specify the corresponding concrete indices instead." message.

Note that there is no specific error message for the case where wildcard expressions match one or more aliases. In fact, aliases are simply ignored when expanding wildcards for such APIs. An error is thrown only when the expression ends up matching no indices at all, and allow_no_indices is set to false. In that case the error is still the generic "404 - no such index".
@javanna javanna force-pushed the enhancement/ignore_alias_error_message branch from c81501b to d589052 Compare July 17, 2017 14:56
@javanna javanna merged commit 5c5d723 into elastic:master Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Indices APIs APIs to create and manage indices and templates >non-issue v6.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants