Update DefBootstrap to handle Error from ClassValue#133604
Update DefBootstrap to handle Error from ClassValue#133604jdconrad merged 7 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
50addc1 to
f573868
Compare
ldematte
left a comment
There was a problem hiding this comment.
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 |
ldematte
left a comment
There was a problem hiding this comment.
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.