On 19/05/2016 21:30, Ryan Pallas wrote:

    Of what value to a subsequent catch statement is the trace of that
    throw statement? And why does that "start a new exception flow",
    but if PDO threw different sub-classes, you could let one flow
    through unmodified by tightening the catch statement?


True, but if you instead of throwing the same exception, threw a new one, you could capture both stacks.

The same could be said of the current behaviour:

throw new PDOException($e->getMessage(), $e->getCode(), $e);

Since this contains both "throw" and "new", it's guaranteed a new stack trace in either convention.

So the question remains which is the *more likely* desired behaviour if you *don't* re-wrap it, and I honestly don't know the answer.

--
Rowan Collins
[IMSoP]


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to