Skip to content
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

Painless: improve error message when parameter must be a constant but isn't #68324

Open
nik9000 opened this issue Feb 1, 2021 · 9 comments
Open
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement Team:Core/Infra Meta label for core/infra team

Comments

@nik9000
Copy link
Member

nik9000 commented Feb 1, 2021

Now the error message is:

"all arguments must be constant but the [2] argument isn't

That isn't really even English. I mean, it tells you where to look and we don't have any better ideas given the infrastructure we have, but we do need to make it better.

@nik9000 nik9000 added >enhancement :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache needs:triage Requires assignment of a team area label labels Feb 1, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Feb 1, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@DaveCTurner DaveCTurner removed the needs:triage Requires assignment of a team area label label Feb 4, 2021
@stu-elastic
Copy link
Contributor

Yes this message should be better. @nik9000 can you provide a brief script illustrating the problem?

@stu-elastic stu-elastic added the good first issue low hanging fruit label Jun 10, 2021
@nik9000
Copy link
Member Author

nik9000 commented Jun 10, 2021

In a runtime field if you do something like:

String a = 'a';
String b = 'b';
grok(a + b);

Which, I think, will reply with something like: "all arguments must be constant but the [1] argument isn't"

@aileenpalafox
Copy link

Hi, can I check this out? First time contributing

@andrevpessanha
Copy link

Hi @nik9000, i opened a PR to solve this issue and since this is my first contribution, i'd be really glad if you could give me some feedback.

@andrevpessanha
Copy link

Hi @nik9000, could you tell me what do you think of these new error messages? I had mapped four occurrences of this type of error, but please let me know if i forgot to update any other messages.

@Kxrr
Copy link
Contributor

Kxrr commented Jan 14, 2022

Could I jump on this issue?

I'm going to optimize the error message to:

All arguments of the [<methodName>] method must be constants, 
but the argument [<argumentName>] is not

@stu-elastic
Copy link
Contributor

@Kxrr, That'd be a good message

@Kxrr
Copy link
Contributor

Kxrr commented Jan 15, 2022

Hi @stu-elastic, could you please review my changes in #82638

@stu-elastic stu-elastic removed the good first issue low hanging fruit label Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants