[HttpKernel] fixed FlattenException status code

This commit is contained in:
Fabien Potencier 2010-09-01 08:49:19 +02:00
parent ad835f8a16
commit ab9be87354

View File

@ -28,6 +28,7 @@ class FlattenException
protected $previous;
protected $trace;
protected $class;
protected $status;
static public function create(\Exception $exception)
{
@ -39,13 +40,19 @@ class FlattenException
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()