tp5,try catch无法捕获异常

浏览:11570 发布日期:2017/06/21 分类:ThinkPHP5专区 关键字: Exception
use think\Exception;function __construct (\think\Request $request = NULL)
    {
        parent::__construct ($request);
        try {
            Gateway::$registerAddress = config ("CHAT2") . ":1236";
        } catch (Exception $e) {
            die("系统服务未正常启动,请联系系统管理员!");
        }

    }
我用的thinkphp的Exception类,但是这个捕获不到异常
报错代码来自workerman提供的gateway类,原因是服务器服务没开启报的错$client = stream_socket_client ('tcp://' . self::$registerAddress, $errno, $errmsg, self::$connectTimeout);报错信息[2] ErrorException in Gateway.php line 874
stream_socket_client(): unable to connect to tcp://127.0.0.1:1236 (Connection refused)
最佳答案
评论( 相关
后面还有条评论,点击查看>>