java代码
public function t(){
try {
throw new \exception(haha);
}catch (exception $e){
dump($e);
}
}
以上catch无法捕捉到,会出现error的页面。因为catch (exception $e){捕获的是当前module的exception类,而不是\exception,因此需要改成
java代码
public function t(){
try {
e(errr);
}catch (\exception $e){
dump($e);
}
}