搜索本产品文档关键词
异常处理
所有文档
menu

音视频直播 LSS

异常处理

LSS异常提示

异常方法
说明
BceBaseException 异常总集
BceClientException 客户端异常
BceServerException 服务器异常
InvalidArgumentException 系统自带异常,参数错误

异常事件获取

您可以使用try-catch获取某个事件所产生的异常:

PHP
1    try {
2        $client->listSessions();
3    }catch (\BaiduBce\Exception\BceBaseException $e) {
4        print $e->getMessage();
5        if (stcmp(gettype($e), "BceClientException") == 0) {
6            print "Catch a client exception";
7        }
8        if (stcmp(gettype($e), "BceServerException") == 0) {
9            print "Catch a server exception";
10        }
11    }
上一篇
LSS开发指南
下一篇
API参考