While integrating the error handling in the Kibana runtime field editor I found an unexpected behaviour with the Painless _executes API error returned.
This the runtime script I provide:
emit('test');
emit(12345678);
emit('test');
And the type is keyword.
I expect it to fail for the emit(12345678) part as I am passing a long and I'd like to be able to underline that part of the script. But the error position that is returned is the following
The offset: 19 is correct as it correspond to the beginning of the 12345678 . But the end is not correct, I would expect 19 + 8 = 27 but instead it indicates end: 43, which is the end of the script and not the end of the error.
As a result this is how the error is underlined in the editor:
Would it be possible to return the end of the error exactly where it ends?
While integrating the error handling in the Kibana runtime field editor I found an unexpected behaviour with the Painless
_executes
API error returned.This the runtime script I provide:
And the type is
keyword
.I expect it to fail for the
emit(12345678)
part as I am passing along
and I'd like to be able to underline that part of the script. But the error position that is returned is the followingThe
offset: 19
is correct as it correspond to the beginning of the12345678
. But the end is not correct, I would expect 19 + 8 = 27 but instead it indicatesend: 43
, which is the end of the script and not the end of the error.As a result this is how the error is underlined in the editor:
Would it be possible to return the
end
of the error exactly where it ends?