Skip to main content

Timeline for answer to rethrowing python exception. Which to catch? by BrenBarn

Current License: CC BY-SA 3.0

Post Revisions

5 events
when toggle format what by license comment
Feb 12, 2024 at 17:29 comment added matanox I personally find the python 3 behavior somewhat opinionated in a wrong way (better have let the catcher decide whether to log the exception they captured or not) and also not consistent with catching without re-raising. The python 3 text "During handling" showing between every two exceptions in the chain of exception captures is quite exacerbating on this tangent. The extended syntax from the other answer side-steps this dubious message, while still making you emit a stacktrace hierarchy of exceptions even if you are fine with only the final one that you choose to raise.
Dec 15, 2019 at 13:40 comment added Binyamin is there a way to get the python 3 behaviour in python 2?
Jul 28, 2014 at 18:51 vote accept Bosiwow
Jul 28, 2014 at 18:48 history edited BrenBarn CC BY-SA 3.0
added 936 characters in body
Jul 28, 2014 at 18:40 history answered BrenBarn CC BY-SA 3.0