try catch的简单使用
try {
CatalogService::test();
} catch (Exception $e) {
return $this->jsonError($e->getMessage());
}
CatalogService
public static function test(){
throw new Exception("出现错误");
}
如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术
转载请注明:异常try catch的简单使用 出自老鄢博客 | 欢迎分享