Skip to content

Commit

Permalink
[HttpKernel] fixed FlattenException status code
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Sep 1, 2010
1 parent ad835f8 commit ab9be87
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -28,6 +28,7 @@ class FlattenException
protected $previous;
protected $trace;
protected $class;
protected $status;

static public function create(\Exception $exception)
{
Expand All @@ -39,13 +40,19 @@ static public function create(\Exception $exception)
if ($exception->getPrevious()) {
$e->setPrevious(static::create($exception->getPrevious()));
}
$e->setStatusCode($exception instanceof HttpException ? $exception->getCode() : 500);

return $e;
}

public function getStatusCode()
{
return $this->getClass() instanceof HttpException ? $this->getCode() : 500;
return $this->status;
}

public function setStatusCode($status)
{
$this->status = $status;
}

public function getStatusText()
Expand Down

0 comments on commit ab9be87

Please sign in to comment.