#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 slabbe):

 > 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 ?

 Yes there is.

 > 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)
 > }}}

 Suppose `import dot2tex` raises an `ImportError` which is caused by the
 importation of another module like `pyparsing` (see the description of the
 ticket). Then the more meaningful message that you can think of will be
 confusing because it will not give you the error traceback for the
 pyparsing import error.

 This is what happen to me for some version of Sage with some version of
 dot2tex spkg two months ago and motivated me to create this ticket. The
 import error of pyparsing was not appearing on the screen and I had to fix
 the code and reraise the real error to see what was the problem.

--
Ticket URL: <http://trac.sagemath.org/ticket/16242#comment:12>
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.

Reply via email to