-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Update DefBootstrap to handle Error from ClassValue #133604
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
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
50addc1
to
f573868
Compare
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 great (if possible) to add a unit test that forces an Exception (checked) inside ClassValue.getFromHashMap
to demonstrate this PR works as intended
modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessWrappedException.java
Show resolved
Hide resolved
modules/lang-painless/src/main/java/org/elasticsearch/painless/DefBootstrap.java
Outdated
Show resolved
Hide resolved
Hi @jdconrad, I've created a changelog YAML for you. |
@ldematte Thanks for the review! I will try to add a jdk25+ specific test. Edit: On second thought, did you want something additional to the changes in |
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 see your point, the test you have basically already cover what is needed, showing that any exception does indeed get wrapped.
I was thinking about a test showing that when a (checked) exception is thrown in ClassValue.getFromHashMap, that exception is not wrapped anymore but it's instead a PainlessWrappedException.
But IDK how easy or difficult it is to do that, nor if this adds a great value, so I'll let you decide if and how you want to add such a test.
LGTM
ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
…lastic#133662) ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
…lastic#133662) ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.
ClassValue.getFromHashMap wraps checked exceptions as Error, but we do not want to crash here because we could not process the type correctly as part of a Painless script, so we instead unwrap the Error and rethrow the original exception.