News for hackers. Stuff that matters.
Re:A Manifesto For Error Reporting by masklinn on Tuesday March 05, 2013 @02:27PM (#5326721)
> For older Python versions please see http://blog.ianbicking.org/2007/09/12/re-raising-exceptions/

This is super important, I recently rediscovered this with a colleague (the company's tool was fucking up exceptions everywhere, either over-logging things or throwing stacktraces out in an attempt to rewrap them and we decided to fix this).

Although the second-to-last example:

    new_exc = Exception("Error in line %s: %s"
                    % (lineno, exc or exc_class))
    raise new_exc.__class__, new_exc, tb
would be much better written as:

    raise Exception, "Error in line %s: %s" % (lineno, exc or exc_class), tb

There are no comments on this comment yet.