PHP 针对nginx 的异常 Exception异常和Error错误都需要捕捉

catth (Error $e)   

直接上代码

try{
    echo asdasdf('111');                    //未定义的函数
    throw new Exception('asdasd');   
}catch (Exception $e){
    echo $e->getMessage();   
}catth (Error $e){
    echo $e->getMessage();
}

 

posted @ 2022-01-25 18:05  树下水月  阅读(41)  评论(0编辑  收藏  举报