[csw-maintainers] pkgcheck phase is failing
Yann Rouillard
yann at pleiades.fr.eu.org
Mon Jan 7 20:56:58 CET 2013
2013/1/7 Maciej (Matchek) Bliziński <maciej at opencsw.org>
> 2013/1/7 Yann Rouillard <yann at pleiades.fr.eu.org>:
> > I think that makes a lot of sense.
> >
> > I suppose we should define some exception class whose instances would at
> > least contain the error message and the information message.
> > Any check could use this exception or a sub-class when they need to
> raise an
> > error.
>
> Each module can define its exceptions; I was following this rule most
> of the time so far. But for simplicity, we should not change the type
> of exception we're raising, only display an error message and
> propagate the exception as-is. This way we keep the code simpler and
> not bury ourselves in an exception handling jungle.
>
You think it will be so complicated if we just use a parent class for all
exceptions (or at least these kind of exceptions) ?
> > Now the question is just: where is the central place to catch these
> > exceptions and display the message ?
>
> I would like to avoid having this. If anything goes wrong, I want to
> crash early and loud.
>
I find cleaner that the function just raises exceptions and that the caller
decides how to handle the message.
I find this more flexible, it allows us to easily make change to the way we
handle these errors if this is done in a one place.
About the need to crash early, what is exactly the risk ? After your
comment, I thought that for exemple an intermediate function might catch
exceptions too broadly and prevents the exception from being properly
handled. I am not sure if this is a big problem. We could easily search for
this kind of exception catch.
At least, I think we should create some common function used by each module
to print the error message so we keep the advantage of not duplicating the
code used to display the error.
>
> > I didn't check yet but I am sure you already have an idea.
> >
> > For the stack trace, we could display it only in debug mode.
>
> I'm thinking that if we don't display the stack trace, we won't be
> able to ask for it right away (“can you show me the stack trace?” --
> “what stack trace?”). Right now people can immediately copy/paste the
> stack trace and quickly give us idea about what's going on. Without
> the stack trace, we'll still have to go and ask people to re-run in
> debug mode, then copy and paste. Why add an additional middle step?
>
Well I understood that the idea was not freak people.
I think that a stack trace can give the impression that the error was not
properly handled and can prevent people from really looking at the output
and see the informative message.
If the stack trace is really long, you might even miss the informative
message.
We can try to lay out the message so we don't miss the informative part,
but we would need to generate the traceback ourself to be able to display
it before the informative message. That would advocate even more to use
some common code to display the error.
Well, that's just my opinion. I am less versed in python that you are.
Yann
>
> Maciej
> _______________________________________________
> maintainers mailing list
> maintainers at lists.opencsw.org
> https://lists.opencsw.org/mailman/listinfo/maintainers
> .:: This mailing list's archive is public. ::.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencsw.org/pipermail/maintainers/attachments/20130107/52203691/attachment.html>
More information about the maintainers
mailing list