3 ms·
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
by joshribakoff 13y ago
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.
- teddyh 13y agoPython 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/ http://www.python.org/dev/peps/pep-0415/
- jafaku 13y agoPHP added exception chaining in 5.3.0 (a few years ago). See $previous: http://www.php.net/manual/en/exception.construct.php http://www.php.net/manual/en/exception.construct.php