tried to avoid guessing template info on errors

This commit is contained in:
Fabien Potencier
2019-03-11 16:04:11 +01:00
parent 04408cda3a
commit 2389faeae3
4 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ class Error extends \Exception
* @param Source|string|null $source The source context where the error occurred
* @param \Exception $previous The previous exception
*/
public function __construct($message, $lineno = -1, $source = null, \Exception $previous = null)
public function __construct($message, $lineno = -1, $source = null, \Exception $previous = null, $autoGuess = true)
{
if (null === $source) {
$name = null;
@@ -80,7 +80,7 @@ class Error extends \Exception
$this->lineno = $lineno;
$this->filename = $name;
if (-1 === $lineno || null === $name || null === $this->sourcePath) {
if ($autoGuess && (-1 === $lineno || null === $name || null === $this->sourcePath)) {
$this->guessTemplateInfo();
}