[ 
https://issues.apache.org/jira/browse/PIG-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571066#action_12571066
 ] 

Benjamin Francisoud commented on PIG-98:
----------------------------------------

I agree with Alan Gates and Pi Song, this error is not really user-friendly :(

I not familiar with javacc but is there a way like in xml with dtd or xml 
schema to validate the script's syntax before running it ?
According to this page: https://javacc.dev.java.net/doc/errorrecovery.html
javacc has already an error handling system with custom Exception just for that 
case ?!

For the [javacc page|https://javacc.dev.java.net/doc/errorrecovery.html]:
{quote}Whenever the parser detects a problem, it throws the exception 
ParseException. Previously, it used to print the message:

  Encountered ... Was expecting one of ...{quote}

It's may be just a matter of improving one of the .jj file to catch such error 
(my 2 cents)

I suppose we could then do something like:
{code:java}
} catch(ParseException e) {
    System.err.println(e.getMessage());
    if (verbose == true) {
        log.error(e);
    }
} catch(Exception e) {
    // all other case than can occur...
    log.error(e.);
}
{code}

did anything that I said make sense ?

> grunt should show full exception stack
> --------------------------------------
>
>                 Key: PIG-98
>                 URL: https://issues.apache.org/jira/browse/PIG-98
>             Project: Pig
>          Issue Type: Improvement
>          Components: grunt
>            Reporter: Stefan Groschupf
>            Priority: Minor
>             Fix For: 0.1.0
>
>         Attachments: showStackTrace-20080207.patch
>
>
> I suggest grunt should be more helpful with user errors. I just did one (a 
> stupid one) and it took my too long to figure out the problem, since grunts 
> error message was just not giving me a good hint:
> grunt> A = LOAD '/pigtestData.tsv' USING PigStorage(',') AS (user,age,cat);
> grunt> B = FILTER A BY cat == 'book';
> grunt> dump B;
> For input string: "book"
> Experts will see that I tried to use == instead of eq, however especially new 
> users could get a little confused. 
> I see two chances add Error Number and  descriptive texts (Oracle style) - 
> this quite a lot of work, or for now I suggest to simply dump the full 
> exception text.
> At least for this early stage it would developers and users to find problems 
> faster.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to