elasticsearch/docs/painless
Stuart Tettemer 4a8e5ada23
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
2020-01-21 10:57:09 -07:00
..
painless-api-reference Remove support for sparse vectors. (#48781) 2019-11-14 16:54:48 -05:00
painless-contexts [DOCS] Fixed typos (_op => op) in Painless context docs (#50301) 2020-01-08 10:52:43 -06:00
painless-guide Scripting: Add char position of script errors (#51069) 2020-01-21 10:57:09 -07:00
painless-lang-spec [DOCS] Correct Painless operator typos (#50472) 2019-12-30 08:48:10 -05:00
index.asciidoc Reorganize Painless doc structure (#42303) 2019-05-21 13:47:47 -04:00
painless-api-reference.asciidoc Task to generate Painless API's per context (#41233) 2019-04-23 09:10:47 -07:00
painless-contexts.asciidoc [DOCS] Moves Watcher content into Elasticsearch book (#47147) 2019-09-27 16:05:44 -07:00
painless-guide.asciidoc Reorganize Painless doc structure (#42303) 2019-05-21 13:47:47 -04:00
painless-lang-spec.asciidoc Reorganize Painless doc structure (#42303) 2019-05-21 13:47:47 -04:00
redirects.asciidoc [DOCS] Add redirect for painless examples anchor 2019-06-25 12:37:21 -04:00