PHP处理异常

更高级别处理异常:

$client = new Client();
$shareUrl = 'https://api.linkedin.com/v2/socialActions/6799906381634912256';
try {
    $response = $client->request('GET', $shareUrl);
    $code = $response->getStatusCode();
} catch (\Throwable $throwable) {
    dump($throwable);
    return false;
}

 

posted @ 2021-05-17 19:00  语不停  阅读(41)  评论(0编辑  收藏  举报