mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Scripting: Add char position of script errors (#51069)
Add the character position of a scripting error to error responses. The contents of the `position` field are experimental and subject to change. Currently, `offset` refers to the character location where the error was encountered, `start` and `end` define a range of characters that contain the error. eg. ``` { "error": { "root_cause": [ { "type": "script_exception", "reason": "runtime error", "script_stack": [ "y = x;", " ^---- HERE" ], "script": "def x = new ArrayList(); Map y = x;", "lang": "painless", "position": { "offset": 33, "start": 29, "end": 35 } } ``` Refs: #50993 * Check position only for 7.7+ * 7.7 && decrement before assign * Use correct experimental tag, update doc test responses, off by one yaml * Do not duplicate error.caused_by in replacement * Add position under causedby
This commit is contained in:
parent
a2f23f7ea0
commit
4a8e5ada23
7 changed files with 149 additions and 21 deletions
|
@ -241,3 +241,14 @@ NOTE: The size of scripts is limited to 65,535 bytes. This can be
|
|||
changed by setting `script.max_size_in_bytes` setting to increase that soft
|
||||
limit, but if scripts are really large then a
|
||||
<<modules-scripting-engine,native script engine>> should be considered.
|
||||
|
||||
[float]
|
||||
[[modules-scripting-errors]]
|
||||
=== Script errors
|
||||
Elasticsearch returns error details when there is a compliation or runtime
|
||||
exception. The contents of this response are useful for tracking down the
|
||||
problem.
|
||||
|
||||
experimental[]
|
||||
|
||||
The contents of `position` are experimental and subject to change.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue