异常try catch的简单使用

try catch的简单使用

```
try {
CatalogService::test();
} catch (Exception $e) {
return $this->jsonError($e->getMessage());
}

CatalogService
public static function test(){
throw new Exception("出现错误");
}
```

    A+
发布日期:2022年09月03日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: