News for hackers. Stuff that matters.
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.
Re:Don’t Use Try/Catch (2010) by teddyh on Saturday December 28, 2013 @01:59PM (#6975828)
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/
Re:Don’t Use Try/Catch (2010) by jafaku on Saturday December 28, 2013 @02:08PM (#6975880)
PHP added exception chaining in 5.3.0 (a few years ago). See $previous:

http://www.php.net/manual/en/exception.construct.php