Skip to content

Commit

Permalink
Enhance FlattenException to include more methods from Exception. That…
Browse files Browse the repository at this point in the history
… allows it to be used in place of Exception in more places.
  • Loading branch information
Crell committed Apr 20, 2012
1 parent e7470ff commit a22f0cd
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Symfony/Component/HttpKernel/Exception/FlattenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class FlattenException
private $class;
private $statusCode;
private $headers;
private $file;
private $line;

static public function create(\Exception $exception, $statusCode = null, array $headers = array())
{
Expand All @@ -42,6 +44,8 @@ static public function create(\Exception $exception, $statusCode = null, array $
$e->setHeaders($headers);
$e->setTrace($exception->getTrace(), $exception->getFile(), $exception->getLine());
$e->setClass(get_class($exception));
$e->setFile($exception->getFile());
$e->setLine($exception->getLine());
if ($exception->getPrevious()) {
$e->setPrevious(static::create($exception->getPrevious()));
}
Expand Down Expand Up @@ -93,6 +97,26 @@ public function setClass($class)
$this->class = $class;
}

public function getFile()
{
return $this->file;
}

public function setFile($file)
{
$this->file = $file;
}

public function getLine()
{
return $this->line;
}

public function setLine($line)
{
$this->line = $line;
}

public function getMessage()
{
return $this->message;
Expand Down

0 comments on commit a22f0cd

Please sign in to comment.