Hi Olga,
I the cookbook idea is really great!

Here my thoughts:

User Errors:
Agreed meaningful error messages for the user.
+ should we start using error codes and a message bundle for i18n in the very long run?
+ in debug mode we should also show the complete strack trace

Internal Errors:
+ java has assert statements and I like them very much since it helps to better understand the code - best documentation is always the code, isnt it? :) http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html It would be great to make the usage of assert to a coding standard in pig

"log the exception message to stderr": I suggest that we do always log using commons logging and have a Console appender and not logging into stderr directly.

Can we find a better name than Frontend Exception? Frontend is widely used for User Interface as well. Maybe Client - but I'm not very happy about client also. :-/

In general I'm in favor of the idea of having those exceptions. All pig exceptions should inheritance from RuntimeException. This would allow us to design API without Exception declaration (unchecked Exceptions). Since your proposal suggest to handle the error always on very top in the stack (what I like a lot) this will clean up all API and make them better understandable.
http://www.javapractices.com/topic/TopicAction.do?Id=129
http://www.onjava.com/pub/a/onjava/2003/11/19/exceptions.html

I'm always happy to assit in doing your suggest changes since we have a hight need in getting pig into a production ready state soon than later. :) Just let me know.

Cheers,
Stefan









On Feb 28, 2008, at 6:06 PM, Olga Natkovich wrote:

Pig developers,

We had many patches submitted that are trying to improve error handling.
This is really great as many users ask exactly for that. So it seems
timely to establish some guidelines on how errors should be handled,
propagated, delivered, etc.

I put together a proposal to start the discussion. Please, review and
comment. Once we have an agreement we would need to add the missing
pieces to deploy it into Pig and then review the existing patches to
make sure they follow the proposed practice.

http://wiki.apache.org/pig/PigDeveloperCookbook

I have also started a general document called Pig Developer Cookbook
where we can keep track of development patterns we as a community want
to follow.

Thanks again for everybody's contributions!

Olga

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101tec Inc.
Menlo Park, California, USA
http://www.101tec.com


Reply via email to