我有以下方法:
function fooAction(Request $request){
$response = new Response();
try{
// Doing some stuff
return $response;
}
catch(\Doctrine\DBAL\DBALException $e) {
$response->setStatusCode(500);
$response->setContent($e->getMessage());
}
catch(\Exception $e ){
$response->setStatusCode(500);
$response->setContent($e->getMessage());
}
return $response;
}
当我调用它时,我得到一个带有空消息的状态代码500。我究竟做错了什么?