学无先后,达者为师

网站首页 PHP其他 正文

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

作者:树下水月 更新时间: 2022-04-05 PHP其他

catth (Error $e)   

直接上代码

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

 

原文链接:https://blog.csdn.net/u013416034/article/details/108574093

栏目分类
最近更新