设置状态代码
public function someAction(){
// Action's code
return new Response($error, 500);
}
另一个例子:
public function someAction(){
// Action's code
$response = new Response();
$response->setStatusCode(500)
$response->setContent($content);
return $response;
}