Re: Exception::getLine()

From: Date: Thu, 19 May 2016 22:14:44 +0000
Subject: Re: Exception::getLine()
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-93405@lists.php.net to get a copy of this message
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]

« previous php.internals (#93405) next »