Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Pig Wiki" for change 
notification.

The following page has been changed by OlgaN:
http://wiki.apache.org/pig/PigDeveloperCookbook

------------------------------------------------------------------------------
  
  It is helpful to be able to separate different types of errors in our code. 
Here is the proposal on how to handle them:
  
-  * For `User Errors`, throw `ParseException` that contains meaningful 
message. For batch and interactive processing, catch the exception in Grunt and 
log the exception message to stderr. The same can be done with the developer in 
the embedded case.
+  * For `User Errors`, throw `ParseException` that contains meaningful 
message. For batch and interactive processing, catch the exception in Grunt and 
log the exception message to stderr. The same can be done with the developer in 
the embedded case. In debug mode, log the exception stack into the client side 
log.
-  * For `Internal Errors`, throw `RuntimeError` that contains meaningful 
message. Catch the exception in main, log it, including the stack, to the 
client side log. Write failure message to stderr pointing to the log file.
+  * For `Internal Errors`, throw `RuntimeException` or its derivation. Catch 
the exception in main, log it, including the stack, to the client side log. 
Write failure message to stderr pointing to the log file.
   * For `Frontend Errors`, throw newly created `FrontendException`. Catch the 
exception in main, log it, including the stack, to the client side log. Write 
failure message to stderr pointing to the log file. In the future, we might 
find it useful to further subdivide this errors in which case we might subclass 
the `FrontendException` class. 
   * For `Backend Errors` there will need to be backend specific way to get the 
error from the backend to the frontend. Once this is done, log the error into 
client side log file and throw `ExecuteException`. Catch the exception in main, 
log it, including the stack, to the client side log. Write failure message to 
stderr pointing to the log file.
   

Reply via email to