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

Ashutosh Chauhan commented on PIG-1531:
---------------------------------------

* In addition to error Msg, you also need to set error code on the exception 
you are throwing.
* Since you are catching exceptions thrown by user code (StoreFunc Interface) 
it is not safe to assume that e.getMessage() will be non-null or non-empty 
string. This will result in NPE. You need to check for it and provide a generic 
error Msg in those cases.
* Generic error msg should also contain output location String. Since if user 
didnt provide it, that wont get printed. So, you can reword the message as 
"Output location validation failed for: <location>. More Information to 
follow:" 
* Since, PigException extends from IOException. The IOException you are 
catching can also be a PigException, you need to test if it is and then set the 
message and error code.
* In case of non-existent input location I am still seeing the generic message 
"ERROR 2997: Unable to recreate exception from backend error: 
org.apache.pig.backend.executionengine.ExecException: ERROR 2118: Unable to 
create input splits for: file:///Users/chauhana/workspace/pig-1531/a" Though 
the full stack trace is printed at the end which contains the underlying error 
String. Its more confusing because now there are three different error messages 
amid a java stack trace.
* This warrants a testcase for regression purposes. (Infact error reporting 
behavior already changed since the time I opened this bug.)

> Pig gobbles up error messages
> -----------------------------
>
>                 Key: PIG-1531
>                 URL: https://issues.apache.org/jira/browse/PIG-1531
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Ashutosh Chauhan
>            Assignee: niraj rai
>             Fix For: 0.8.0
>
>         Attachments: PIG_1531.patch
>
>
> Consider the following. I have my own Storer implementing StoreFunc and I am 
> throwing FrontEndException (and other Exceptions derived from PigException) 
> in its various methods. I expect those error messages to be shown in error 
> scenarios. Instead Pig gobbles up my error messages and shows its own generic 
> error message like: 
> {code}
> 010-07-31 14:14:25,414 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 
> 2116: Unexpected error. Could not validate the output specification for: 
> default.partitoned
> Details at logfile: /Users/ashutosh/workspace/pig/pig_1280610650690.log
> {code}
> Instead I expect it to display my error messages which it stores away in that 
> log file.

-- 
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