Skip to content

Conversation

YusukeHosonuma
Copy link
Contributor

In current, error line number is fixed 1 when query has error.
This PR is improve that show actual error line number.

For example, below query has syntax error.

GET /library/book/_search
{
  "query": {
    "field":{
      "title": "test"
    }
  }
}

Current: error line number is fixed 1.

...
[Response]

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "no [query] registered for [field]",
        "line": 1,
        "col": 19
      }
    ],
    "type": "parsing_exception",
    "reason": "no [query] registered for [field]",
    "line": 1,
    "col": 19
  },
  "status": 400
}

After merged this PR:

...
[Response]

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "no [query] registered for [field]",
        "line": 4,
        "col": 13
      }
    ],
    "type": "parsing_exception",
    "reason": "no [query] registered for [field]",
    "line": 4,
    "col": 13
  },
  "status": 400
}

Please consider merging if you do not mind.

regards.

@jitcoder
Copy link
Owner

thank you for the PR! i will take a look today and create a patch today/tomorrow.

@YusukeHosonuma
Copy link
Contributor Author

I'm glad if you check it when you have time. (This is a reminder)

@jitcoder jitcoder merged commit b386c67 into jitcoder:master Jul 20, 2017
@jitcoder
Copy link
Owner

there are some things in there that I wanted to change but unfortunately I did not have enough time so I'm merging this anyways :)

@YusukeHosonuma YusukeHosonuma deleted the correct-error-line branch July 20, 2017 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants