Tim Foster wrote:
Hi Saurabh,
On Thu, 2010-04-22 at 16:06 +0530, Saurabh Vyas wrote:
Bug-id : pkgsend generate traceback when bundle doesn't exist
webrev : http://cr.opensolaris.org/~saurabhv/fix-15646/
Rather than just printing an error message inside gen_actions() and
continuing, you should find a way to have trans_generate() detect the
error and return a non-zero exit code back to main_func()
I'd suggest raising an exception from gen_actions for this case,
handling it in trans_generate(), printing the exception message, then
returning a non-zero exit code.
Thanks for the inputs Tim.
So now I am raising pkg.actions.ActionDataError from gen_actions() and
handling this in trans_generate() (with non zero exit)
Is pkg.actions.ActionDataError right error to use or should another
error type needs to be defined ?
Just for ref : http://cr.opensolaris.org/~saurabhv/fix-15646-rev-1/
Question : Can't we directly handle this error in gen_actions() itself?
(as we know that we cannot recover from this error & should quit with
zero zero code).
You also need to include a test case for this bug
in ./src/tests/cli/t_pkgsend.py
I will add the test case and send the final webrev soon.
Thanks,
~Saurabh
cheers,
tim
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss