#16242: assert_have_dot2tex should reraise exception not replace it
-------------------------------------+-------------------------------------
Reporter: slabbe | Owner: slabbe
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.3
Component: packages: | Resolution:
optional | Merged in:
Keywords: | Reviewers:
Authors: Sébastien Labbé | Work issues:
Report Upstream: N/A | Commit:
Branch: u/slabbe/16242 | ecc5f70423cf25c566fd8f30364a3ffe295d6ad8
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by ncohen):
> I want to keep the message. This is the purpose of this ticket. Changing
the error message just hide the real problem.
What I understand is that formerly ths try/except contained too much,
while with your patch it only contains the import statement.
Sooooooooo there is no risk that catching this !ImportError and raising
another importerror with a more useful information (i.e. how to install
the spkg) would hide anything, is there ?
> Because it was like that before and because that printed message is
unrelated to the purpose of the ticket. I kept the message because it just
gives more information.
The message is useful indeed, but you print it before raising an
exception.
> BEFORE:
> - print error info about dot2tex (unrelated to the goal of the
ticket)
> - then raise `RunTimeError` with error info about dot2tex (related to
the actual ticket)
>
> NOW:
> - print error info about dot2tex
> - then reraise the error
>
> Ok maybe print statement is not clean I agree. Do you want me to fix
that part in this ticket? But how should it be then? How to add cleanly
info before raising an exception?
I still do not understand. What could possibly go wrong with that :
{{{
try:
import dot2tex
except ImportError:
raise
ImportError(the_more_meaningful_message_that_you_currently_print)
}}}
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/16242#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.