-
Notifications
You must be signed in to change notification settings - Fork 101
Fix optional/missing fields reported via Java client issues #1823
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ import { Dictionary } from '@spec_utils/Dictionary' | |
import { Field } from '@_types/common' | ||
import { Script } from '@_types/Scripting' | ||
|
||
export type RuntimeFields = Dictionary<Field, RuntimeField | RuntimeField[]> | ||
export type RuntimeFields = Dictionary<Field, RuntimeField> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we know why this originally was made an array? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No idea. There's no occurrence of the array variant in our recordings and looking at the ES source code it has always expected the mapping to be an object and not an array. |
||
|
||
export class RuntimeField { | ||
format?: string | ||
|
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.
Hmm! When can an error not have a
reason
?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 went digging to understand this, as it was surprising but happening in the wild ;-)
ErrorCause
is the JSON representation of a Java exception (aThrowable
). Thereason
field is the result of Java'sThrowable.getMessage()
, which according to the docs can benull
. In practice this never (I guess) happens for the top-level error, which is generally anElasticsearchException
. The error here happened in a deeper root cause, where apparentlygetMessage()
returnednull
🤷Uh oh!
There was an error while loading. Please reload this page.
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.
null can happen when it's same exception as before in case of
NullPointerException
- jvm can optimize them out