2
您好我有以下幾點:Predis - 捕獲連接錯誤
// Named array of connection parameters:
$redis = new Predis\Client([
'scheme' => 'tcp',
'host' => $host,
'port' => $port,
'password' => $auth,
]);
try {
// explicitly call Predis\Client::connect()
$redis->connect();
}
catch (Exception $e) {
return Redirect::to('profile')
->with('result', '<div class="col-lg-12"><div class="alert alert-danger alert-border-left alert-gradient alert-dismissable">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
<i class="fa fa-check pr10"></i>
<strong>Error - '.$e.'</strong> Unable to connect to redis server, please double check your database detals.</div></div>');
}
但是這並不捕捉錯誤,如NOAUTH。
有人能指出我正確的方向嗎?
嘗試'catch(\ Exception $ e)' – lukasgeiter 2015-02-08 13:34:32
嗨,nope仍然沒有捕獲錯誤 – user3662307 2015-02-08 13:36:46