[ 
https://issues.apache.org/jira/browse/TAJO-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14214341#comment-14214341
 ] 

Jaewoong Jung commented on TAJO-1178:
-------------------------------------

Thanks for the great suggestion!

How did you implement it? I think it'd be another good improvement if you can 
do it without passing down the JSON object's name or adding a catch clause to 
the caller side.

Plus, given that top level objects don't have a name, (i.e. in you example, if 
the last "OpType": "Projection" is missing, there's no location name to show) 
printing out the problematic JSON object's content might be a good idea.

On CommonGsonHelper:90, change this
{code}
    throw new JsonParseException("Field not found: " + memberName);
{code}
to
{code}
    throw new JsonParseException("Field not found '" + memberName + "' in JSON 
Object '" + object.toString() + "'");
{code}

Then, output will be like this:
{code}
ERROR: Field not found 'OpType' in JSON Object '{"ColumnName":"n_nationkey"}'
{code}

Of course, we can do both whenever available.

> Some error messages for wrong JSON queries are not so much helpful
> ------------------------------------------------------------------
>
>                 Key: TAJO-1178
>                 URL: https://issues.apache.org/jira/browse/TAJO-1178
>             Project: Tajo
>          Issue Type: Bug
>            Reporter: Jaewoong Jung
>            Assignee: Jaewoong Jung
>            Priority: Trivial
>         Attachments: TAJO-1178.Jung.111614.patch.txt
>
>
> When some required fields are missing, (e.g. OpType) tsql shows a dumb error 
> message, "ERROR: java.lang.NullPointerException", which helps little in 
> figuring out the problem.
> It should be more user-friendly like "Missing required filed: OpType".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to