Re:Don’t Use Try/Catch (2010)
by joshribakoff on Saturday December 28, 2013 @12:16PM
(#6975434)
I absolutely agree. Magento does this & its one of the reasons why it sucks. They catch an exception, and throw a new one. Basically eating the message & stack trace. Then that one in turn gets caught and a 3rd new exception is thrown, eating it up again. By the time it bubbles up, your stack trace is totally useless.
[ Parent
| on HN ]
Python 3.3 fixes this, by implementing PEP 415¹, which keeps the original exception available by using this syntax:
except SomeException as exception:
raise NewException("stuff happened") from exception
1) http://www.python.org/dev/peps/pep-0415/PHP added exception chaining in 5.3.0 (a few years ago). See $previous: