try {
$error = 'Always throw this error' ;
throw new Exception ( $error );
// 不执行下面的异常代码。
echo 'Never executed' ;
} catch ( Exception $e ) {
echo '捕获的异常: ' , $e -> getMessage (), "\n" ;//$e->getMessage();获取抛出的信息
}
// 继续执行
echo 'Hello World' ;exit;